Skip to content

Instantly share code, notes, and snippets.

View joedotjs's full-sized avatar
🤹‍♀️

Joseph Alves joedotjs

🤹‍♀️
  • App Academy
  • Weehawken, NJ
View GitHub Profile
@joedotjs
joedotjs / gist:695acb0a6ec5db9206df
Created February 4, 2015 02:43
REACTO spy spec
var spyOn = require('./spy');
var assert = require('assert');
describe('spyOn', function () {
it('should be a function', function () {
assert(typeof spyOn === 'function', 'spyOn is not a function.');
});
describe('functionality', function () {

Open projects looking for partners (Idea - Person)

var Promise = require('bluebird');
var pipeline = function (tasksThatReturnPromises, prevValue) {
var first = tasksThatReturnPromises.shift();
return Promise.resolve(first(prevValue)).then(function (v) {
if (tasksThatReturnPromises.length === 0) {
return v;
} else {
// Running on your computer.
var express = require('express');
var http = require('http');
var fs = require('fs');
var server = http.createServer();
var app = express();
server.on('request', app);

Javascript

Javascript: The Good Parts -- Beginner/Intermediate

http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742

Legendary book, a must-read for any Javascript programmer at least once. Goes into the basics of Javascript with the assumption that the reader is an experienced programmer already, coming from another language or already understands a fair bit about Javascript itself. Very good review of basics and more advanced concepts (like scope/closure, functions as first class objects, etc).

Javascript Design Patterns (Stoyan Stefanov) -- Intermediate

@joedotjs
joedotjs / promisify.js
Created August 8, 2016 15:43
bluebird.promisify
Promise.promisify = function (fnThatTakesCallbacks) {
return function () {
var args = [].slice.call(arguments);
return new Promise(function (resolve, reject) {
fnThatTakesCallbacks.apply(this, args.concat(function (err) {