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
{EventEmitter} = require "events" | |
backoff = require "backoff" | |
WebSocket = require "ws" | |
class EverSocket extends EventEmitter | |
constructor: (url, options) -> | |
@connected = false | |
@reconnect = true | |
@backoff = backoff.fibonacci() |
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
// node lock-catcher.js myprogram.go | |
var reader = require('line-reader') | |
var file = process.argv[2] | |
var prev = null | |
reader.eachLine(file, function (line) { | |
if (prev && /Lock/.test(prev) && !/defer/.test(line)) { | |
console.error('You probably messed up.') | |
} |
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
Chapter 9 / Mira / Page 59 | |
"Through you off" -> "Throw" | |
Chapter 11 / After 10 Qs / Page 70 | |
"rather than the a crisp" | |
Chapter 16 / Limitations / Page 103 | |
"What product to build?" | |
"FaceBook" inconsistent |
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 you have font size around 12, it's pretty annoying to have no space at the top | |
of the file. To fix, add this class selection. | |
*/ | |
atom-text-editor:not(.mini)::shadow { | |
.scroll-view { padding-top: 10px; } | |
.gutter { padding-top: 10px; } |
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
open http://localhost:8080/bundle | |
webpack-dev-server --config webpack.test.js --hot |
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 through = require('through2') | |
function subscribe (collection, params) { | |
var options = { | |
tailable: true, | |
awaitData: true, | |
noTimeout: true, | |
numberOfRetries: Number.MAX_VALUE, | |
} | |
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
YQL('yahoo.finance.quotes') | |
.where({ symbol: [ '^IXIC' ] }) | |
.select([ 'Symbol', 'LastTradePriceOnly', 'Change', 'PercentChange' ]) | |
.then(function (results) { | |
console.log(results) | |
}) | |
YQL('yahoo.finance.historicaldata') | |
.where('symbol', '=', 'PRFC') | |
.where({ startDate: new Date(2015, 4, 1), endDate: new Date(2015, 4, 23) }) |
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 PassThrough = require('stream').PassThrough | |
function createChildStream(ref) { | |
var stream = new PassThrough({ objectMode: true }) | |
ref.limitToLast(1).once('child_added', function(snap) { | |
var stopKey = snap.key() | |
ref.on('child_added', function(snap) { | |
stream.push(snap.val()) | |
if (snap.key() == stopKey) { | |
ref.off('child_added') |
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 'set' | |
one = ARGV.shift | |
two = ARGV.shift | |
xs, ys = [ one, two ].map do |app_name| | |
text = `heroku config -a #{app_name}` | |
Set.new(text.scan(/^(\w+):/)) | |
end |