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
function sizeOf(url, callback) { | |
var image = new Image(); | |
image.src = url; | |
image.onload = function () { | |
callback && callback(null, {width: image.width, height: image.height, ratio: image.width/image.height, img: image}) | |
} | |
image.onerror = function(){ | |
callback && callback('error') | |
} | |
} |
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' | |
var queue = require('async').queue | |
var cache = require("imgcache") | |
var _ = require('lodash') | |
// query the stories | |
// query content of eachStories | |
// then findURLInObject |
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
{ | |
"bistre":"1.0.1", | |
"budo":"8.3.0", | |
"cordova":"6.3.1", | |
"devtool":"2.0.3", | |
"firebase-tools":"3.0.7", | |
"generator-babel-boilerplate":"10.0.1", | |
"gulp":"3.9.1", | |
"hihat":"2.6.4", | |
"hotel":"0.5.4", |
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 socket = require('socket.io-client')('http://spacebro.space:8080'); | |
var startTime; | |
setInterval(function() { | |
socket.emit('latency', Date.now(), function(startTime) { | |
var latency = Date.now() - startTime; | |
console.log(latency); | |
}) | |
}, 2000); |
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
{ | |
"bodies": [ | |
{ | |
"bodyIndex": 0, | |
"tracked": false | |
}, | |
{ | |
"bodyIndex": 1, | |
"tracked": false | |
}, |
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
require('shelljs/global') | |
var fs = require('fs') | |
var handlebars = require('handlebars') | |
var targz = require('tar.gz') | |
var file = './pm2-auto.json' | |
cd('test-settings') | |
rm('-rf', '.build'); | |
var meteorSettingsFile = fs.readFileSync('./test.json', "utf8") | |
var pm2startTemplate = handlebars.compile(fs.readFileSync('./pm2-start.tpj', "utf8")) |
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
const request = require('request') | |
const _ = require('lodash') | |
const postData = { | |
access_token:"28h9_iVDARWp5YD8R9_9c4ECK6kcLyXl6cRmc2m28htKORykzgU9w3QkYkUFLc98K61_Ecc9y4-j3bwvW9UpyinCPnf0FfG4bbkwvEwVqPA8ozyXtxd3zJaAo6DMDcVbRqU1XPMnQrk3FIgAwijyGYRft3LvvGd-ALYuI3xg_7R-5yamkd49xgnG6FduR7iuENi5TavP1vCKGaC2Dyia8Z99nWst8-bcwe5Y2beKjB0qcGLJdjFeHEsatox2jBmUuR-CmmPjS57Cz", | |
cursor:"", | |
limit:1000, | |
since:0 | |
} | |
var url = 'https://chatman-eu-central-1.periscope.tv/k=1ypKdWqyPOgxW/chatapi/v1/history' |
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
{ | |
"access_token":"28h9_iVDARWp5YD8R9_9c4ECK6kcLyXl6cRmc2m28htKORykzgU9w3QkYkUFLc98K61_Ecc9y4-j3bwvW9UpyinCPnf0FfG4bbkwvEwVqPA8ozyXtxd3zJaAo6DMDcVbRqU1XPMnQrk3FIgAwijyGYRft3LvvGd-ALYuI3xg_7R-5yamkd49xgnG6FduR7iuENi5TavP1vCKGaC2Dyia8Z99nWst8-bcwe5Y2beKjB0qcGLJdjFeHEsatox2jBmUuR-CmmPjS57Cz", | |
"cursor":"", | |
"limit":1000, | |
"since":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
var machina = require('machina') | |
require('blissfuljs') | |
var vehicleSignal = new machina.Fsm( { | |
// the initialize method is called right after the FSM | |
// instance is constructed, giving you a place for any | |
// setup behavior, etc. It receives the same arguments | |
// (options) as the constructor function. | |
initialize: function( options ) { |
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 superagent = require('superagent') | |
require('superagent-cache')() | |
var uri = 'http://keepcontrol.space/swanmgmt/wp-json/menu/v2/menu?slug=main' | |
superagent | |
.get(uri) | |
.end(function (error, response){ | |
console.log(response.body) | |
} | |
) |