Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
Some exercises from the Falsy Values workshops.
The good parts:
| class Singleton | |
| # We can make private variables! | |
| instance = null | |
| # Static singleton retriever/loader | |
| @get: -> | |
| if not @instance? | |
| instance = new @ | |
| instance.init() | |
| gmon.out | |
| v8.log |
| /* | |
| jQuery.extend extracted from the jQuery source & optimised for NodeJS | |
| Twitter: @FGRibreau / fgribreau.com | |
| Usage: | |
| var Extend = require('./Extend'); | |
| // Extend | |
| var obj = Extend({opt1:true, opt2:true}, {opt1:false}); |
| function interval(duration, fn){ | |
| var _this = this | |
| this.baseline = undefined | |
| this.run = function(){ | |
| if(_this.baseline === undefined){ | |
| _this.baseline = new Date().getTime() | |
| } | |
| fn() | |
| var end = new Date().getTime() |
| import org.json.*; | |
| import java.net.*; | |
| import java.util.Iterator; | |
| PImage bg; | |
| JSONObject data; | |
| double west = -3.414001; | |
| double east = -3.017120; |
This is a mini howto on moving a subdirectory to its own repository retaining history
Assume PARENT is the original parent Git repository (locally) and CHILD is the new local repository that you wish to create from a subdirectory, retaining all of its history from the PARENT repository; PARENT_PATH and CHILD_PATH are the paths to PARENT and CHILD respectively; SUBDIR is the relative path within the repository under extraction:
git clone --no-hardlinks PARENT_PATH CHILD_PATHpushd CHILD_PATH| #!/usr/bin/env node | |
| var util = require('util'), | |
| http = require('http'), | |
| events = require('events'), | |
| oauth = require('oauth').OAuth, | |
| fs = require("fs"), | |
| crypto = require("crypto"), | |
| ws = require('websocket-server'); |