This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import koa from "koa"; | |
import Router from "koa-router"; | |
import logger from "koa-logger"; | |
import json from "koa-json"; | |
import bodyParser from "koa-bodyparser"; | |
import serve from "koa-static"; | |
import websockify from "koa-websocket"; | |
import cors from "@koa/cors"; | |
import { createReadStream } from 'fs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getTokenBalance(address) { | |
const contractABI = require(baseDir + '/bin/contracts/' + config.CONTRACT_ABI_FILE_NAME.USDC); | |
const web3 = new Web3(new Web3.providers.HttpProvider(config.INFURA_NETWORK_URL)); | |
const USDContractInstance = await new web3.eth.Contract(contractABI, config.CONTRACT_ADDRESS.PROXY); | |
let balance = await USDContractInstance.methods.balanceOf(address).call(); | |
balance = web3.utils.hexToNumber(balance) / Math.pow(10, 6); | |
return balance; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"items": [ | |
{ | |
"Date": "2020-01-22", | |
"Country/Region": "Morocco", | |
"Province/State": "", | |
"Lat": 31.7917, | |
"Long": -7.0926, | |
"Confirmed": 0, | |
"Recovered": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (str) => { | |
str = String(str).toString(); | |
str = str.replace(/^\s+|\s+$/g, ""); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
const swaps = { | |
'0': ['°', '₀', '۰', '0'], | |
'1': ['¹', '₁', '۱', '1'], | |
'2': ['²', '₂', '۲', '2'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1CfYvziQC6nmeQAduStsDRDDXW2v4APTcx https://explorer.blockstack.org/address/1CfYvziQC6nmeQAduStsDRDDXW2v4APTcx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Up-To-Date script as of July 4, 2016 | |
# Tested on: "Linux Ubuntu 14.04 LTS 64-bit" | |
# Tested on: "Linux Mint 17.2 Cinnamon 32-bit" | |
# Oracle VirtualBox v5.0.16 r105871 | |
# [- Prepare System -] | |
sudo apt-get update | |
sudo apt-get install -y python-software-properties | |
sudo apt-get install -y python make build-essential g++ curl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Col = require('react-bootstrap/lib/Col') | |
var PageHeader = require('react-bootstrap/lib/PageHeader') | |
var React = require('react') | |
var Row = require('react-bootstrap/lib/Row') | |
var {connect} = require('react-redux') | |
var {reduxForm} = require('redux-form') | |
var DateInput = require('./DateInput') | |
var FormField = require('./FormField') | |
var LoadingButton = require('./LoadingButton') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isServer) { | |
Meteor.startup(function () { | |
process.env.MAIL_URL = 'smtp://username:[email protected]'; | |
Accounts.emailTemplates.siteName = "My Website Name"; | |
Accounts.emailTemplates.from = "My Website Name <[email protected]>"; | |
Accounts.emailTemplates.resetPassword.subject = function(user) { | |
return "How to reset your password for My Website Name"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, os.path, time, urllib, urllib2, json, datetime | |
base = os.getcwd() + '/packages/' | |
apiUrl = 'https://atmospherejs.com/a/packages/findByNames' | |
for dirname in os.listdir(base): | |
max_mtime = 0 | |
if os.path.isdir(base + dirname): | |
packageName = dirname.replace('-', ':', 1) | |
for fname in os.listdir(base + dirname): | |
full_path = base + dirname + '/' + fname |