sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum-unstable
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 request = require('request-promise'); | |
var main = function() { | |
var myAPIKey = process.env.MYAPIKEY; | |
var url = 'https://externalapi.service.com/v1/query?key=' + myAPIKey; | |
return request(url); | |
}; |
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 request = require('request-promise'); | |
var main = function() { | |
var myAPIKey = 'ndsvn2g8dnsb9hsg'; | |
var url = 'https://externalapi.service.com/v1/query?key=' + myAPIKey; | |
return request(url); | |
}; |
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
#!/bin/bash | |
# This script is expecting five environment variables | |
# - COUCH_URL = the URL of the Cloudant service e.g. https://u:p@host.cloudant.com | |
# - COUCH_DBNAME = the name of the Cloudant database e.g. petition | |
# - SENDGRIDBEARER = the API key used to communicate with sendgrid | |
# - SENDGRIDSENDER = the email address that emails will appear to come from | |
# - SENDGRIDTEMPLATEID = the email template id to email | |
if [ -z "$COUCH_URL" ]; then echo "COUCH_URL is required"; exit 1; fi | |
if [ -z "$COUCH_DBNAME" ]; then echo "COUCH_DBNAME is required"; exit 1; fi |
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
sns.on('notification', function(n) { | |
// your code here | |
} |
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 pos = { | |
"x": 168.5514677267044, | |
"y": 529.3377142251632, | |
"rounds": 509, | |
"missile": [], | |
"direction": 6 | |
} | |
sns.send( | |
{ type: 'game', colour: 'red' }, | |
{ action: 'position', colour: 'white', data: pos }); |
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 sns = new SNSClient('myapikey', { | |
userData: { | |
type: 'game', | |
colour: 'white' | |
}, | |
userQuery: { | |
type: 'game' | |
} | |
}); |
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
"use strict" | |
const path = require('path'); | |
const router = require('express').Router(); | |
const hostname = 'localhost' | |
// my custom routes add to 'router' | |
router.get('/my/route', function(req, res) { | |
res.send({ok:true}); | |
); |
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
{ | |
"x": 168.5514677267044, | |
"y": 529.3377142251632, | |
"rounds": 509, | |
"missile": [{ | |
"x": 1.471789304834207, | |
"y": 511.7769323961955, | |
"speed": 9, | |
"direction": 6 | |
}, { |
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
[ | |
{ | |
"endpoint": "/", | |
"method": "GET", | |
"database": ["Cloudant", "CouchDB"], | |
"summary": "Meta information about the cluster.", | |
"comment": "" | |
}, | |
{ | |
"endpoint": "/_active_tasks", |