Skip to content

Instantly share code, notes, and snippets.

View Raynos's full-sized avatar

Jake Verbaten Raynos

View GitHub Profile
var middleware = function() { ... }
var stack = middleware(function(data1, data2, next) {
}, function(data1, data2, next) {
}, function(data1, data2, next) {
});
uncaught: Error: ECONNREFUSED, Connection refused
at Socket._onConnect (net.js:601:18)
at IOWatcher.onWritable (net.js:186:12)
@Raynos
Raynos / Better.js
Created September 7, 2011 14:20 — forked from robotlolita/gist:1174881
Constructors
var Mage = {
cast: function _cast() {
console.log(this.name + ' cast ' + magic);
}
};
var BlackMage = {
fira: function _fira() { this.cast('fira') },
watera: function _watera() { this.cast('watera') }
blizarra: function _blizarra(){ this.cast('blizarra') }
"prototype": function _prototype(proto) {
return this.assert(
proto.isPrototypeOf(this.obj),
"expected " + this.inspect + " to have " + i(proto) + " in it's prototype chain",
"expected " + this.inspect + " to not have "+ i(proto) + " in it's prototype chain"
);
},
var db = new Db('node-mongo-blog', new Server(host, port, {}), {native_parser:true});
var blogstack = middleware(function(db, data, next) {
db.open(function(err, db) {
data.db = db;
next();
});
}, function(db, data, next) {
db.dropDatabase(function(err, result) {
next();
require("http").createServer(function(req, res) {
res.end("BROWSER SHARING WITH NODE AND JS");
}).listen(80);
<form>
<div class="cb_lnmlbl"><h3>Select a City</h3></div>
<div class="wh_citycb">
<select size="1" >
<option>Mumbai</option><option>Delhi</option><option>Lucknow</option><option>Indore</option><option>Bengaluru</option><option>Kolkata</option>
</select>
</div>
<div class="wh_citylb"><label name="citynm">Mumbai</label> <label name="citydate"> May 10th</label></div>
var request = require("request-middleware");
var errorFunction = function(err, res, body, next) {
if (err.type === "timeout") {
this.repeat();
} else {
next(err);
}
};
@Raynos
Raynos / foo.js
Created September 13, 2011 20:10
/*
> Database persistence
server -
> CSS
> Server side logic - > HTML
> Client side logic (JS)
*/
class Employee
class FullTimeEmployee inherits Employee
class PartTimeEmployee inherits Employee
// versus
class Employee