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
void function(){ | |
var pool = require('./pool.js') | |
var leading = require('./integer_bits.js').leading | |
module.exports = function left_shift(integer, n){ | |
var words = Math.floor(n / 16) | |
var bits = n % 16 | |
var diff = Math.ceil((n - leading(integer))/16) | |
var size = integer[1] + diff | |
var shifted = pool('integer', size) | |
for ( var i = shifted.length - 1; i > 2; i-- ) { |
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 viral = require('viral') // https://github.com/hughfdjackson/viral | |
function enslave(fn){ | |
return function(){ return fn.bind(null, this).apply(null, arguments) } | |
} | |
function fullName(person){ | |
return person.first + ' ' + person.last // this fullname algorithm is fucking stupid and should never be used. | |
} | |
function fullNameReverse(person){ |
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 viral = require('viral') | |
function enslave(fn){ return function(){ return fn.bind(null, this).apply(null, arguments) } } | |
function say(car){ | |
console.log([car.maker, car.plate].join(" with plate ")) | |
} | |
var Car = viral.extend({ | |
maker: null | |
, plate: "unknown" | |
, say: enslave(say) | |
}) |
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
// try requiring some modules from NPM and then hit Run | |
var strip = require('strip-comments') | |
var src = '(' + function () { | |
var xs = [ 1, 2, [ 3, 4 ] ]; | |
//this is comment | |
var ys = [ 5, 6 ]; | |
/* another | |
comment */ | |
console.dir([ xs, ys ]); | |
} + ')()'; |
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
/*jshint asi:true*/ | |
function chars(c){ | |
return (/[a-z0-9]/).test(c) | |
} | |
function isit(w){ | |
w = w.toLowerCase().split('').filter(chars) | |
while ( w.length > 1 && w[0] == w[w.length -1] ){ | |
w = w.splice(1, w.length - 2) | |
} | |
console.log(w) |
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
module.exports = init | |
var mercury = require('mercury') | |
var h = mercury.h | |
var incrdecr = require('../parts/incrdecr.js') | |
var computed = mercury.computed | |
var clrcnvrt = require('color-convert') | |
var liberate = require('liberate') | |
var map = liberate(Array.prototype.map) |
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 P = require('bluebird') | |
var fs = require('fs') | |
var path = require('path') | |
var request = require('request') | |
var rq = P.promisify(request) | |
var trumpet = require('trumpet') | |
var concat = require('concat-stream') | |
var tr = trumpet() | |
var Stream = require('stream') |
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 viral = require('viral') // https://github.com/hughfdjackson/viral | |
function enslave(fn){ | |
return function(){ return fn.bind(null, this).apply(null, arguments) } | |
} | |
function fullName(person){ | |
return person.first + ' ' + person.last // this fullname algorithm is fucking stupid and should never be used. | |
} | |
function fullNameReverse(person){ |
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
module.exports = DeferredAsObservable | |
var hg = require('mercury') | |
var liberate = require('liberate') | |
var slice = liberate(Array.prototype.slice) | |
function DeferredAsObservable(deferred) { | |
var observable = hg.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
((nil . ((indent-tabs-mode . nil) | |
(tab-width . 4) | |
(fill-column . 130)))) |
OlderNewer