(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.
| // Brightness math based on: | |
| // http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx | |
| $red-magic-number: 241; | |
| $green-magic-number: 691; | |
| $blue-magic-number: 68; | |
| $brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number; | |
| @function brightness($color) { | |
| // Extract color components | 
| // This event emitter emits events, but reserves the right to publish events to | |
| // for its creator. It uses a WeakMap for true encapsulation. | |
| const eesToEventMaps = new WeakMap(); | |
| export default class EventEmitter { | |
| constructor(publisher) { | |
| const eventMap = Object.create(null); | |
| eesToEventMaps.set(this, eventMap); | 
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| concat: { | |
| options: { | |
| separator: ';' | |
| }, | |
| dist: { | |
| src: ['src/**/*.js'], | |
| dest: 'dist/<%= pkg.name %>.js' | 
A lightweight node port of websocketd, originally written in go.
node-websocketd --port=8080 ./count.sh| module.exports = function () { | |
| // If there is an uncaught exception anywhre in your app, it will result in a proper 500 page. | |
| if (Math.random() < 0.3) throw new Error("Oops, my random is low"); | |
| // They don't have to happen in the first tick either | |
| if (Math.random() < 0.2) return setTimeout(function () { | |
| throw new Error("Delayed random bites"); | |
| }); | |
| // If you throw an object, it will send a JSON document to the client | |
| if (Math.random() > 0.6) throw {Hello: request.url}; | 
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
using level-sublevel, level-sec and validimir to have
| /** @jsx React.DOM */ | |
| var MyRootComponent = React.createClass({ | |
| getInitialState: function() { | |
| return {perMinute: '-', perDay: '-'}; | |
| }, | |
| componentDidMount: function() { | |
| var socket = io.connect(this.props.url); | |
| socket.on('business.clickout', this.setState.bind(this)); | |
| }, | |
| render: function() { |