(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
This is now an actual repo:
var isPrimitive = function(val) { | |
return val !== function() { return this; }.call(val); | |
}; |
// No imports, those are more work, especially for plain browser. | |
// However, as soon as you have imports, you should switch to AMD on browsers. | |
// Related: http://www.2ality.com/2011/11/module-gap.html | |
({ define: | |
typeof define === "function" ? | |
define | |
: typeof module !== "undefined" ? | |
function(F) { module.exports = F() } | |
: function(F) { this.defClass = F() }.bind(this) |
(function(global) { | |
global.Functor = function(conf) { | |
Functor.types[conf.key] = { | |
obj: conf.obj, | |
fmap: conf.fmap | |
}; | |
}; | |
Functor.types = {}; |
/*global angular: true, google: true, _ : true */ | |
'use strict'; | |
angular.module('geocoder', ['ngStorage']).factory('Geocoder', function ($localStorage, $q, $timeout) { | |
var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {}; | |
var queue = []; | |
// Amount of time (in milliseconds) to pause between each trip to the |
function sendError(message, url, lineNum) { | |
var i; | |
// First check the URL and line number of the error | |
url = url || window.location.href; | |
lineNum = lineNum || 'None'; | |
// If the error is from these 3rd party script URLs, we ignore | |
// We could also just ignore errors from all scripts that aren't our own | |
var scriptURLs = [ |
/* | |
* Simple Pub/Sub Implementation for jQuery | |
* | |
* Inspired by work from Peter Higgins (https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js) | |
* | |
* This is about the simplest way to write a pubsub JavaScript implementation for use with jQuery. | |
*/ | |
(function( $ ) { | |
// Cache of all topics |
// clean and pure: | |
function cons(x, y) { | |
return function(pick) { | |
return pick(x, y); | |
} | |
} | |
// does more stuff: | |
function cons(x, y) { | |
var fn = function(pick) { |