Make sure that git binary is in your PATH environment variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, app = express() | |
, port = 3000 | |
, staticPath = '/../sources' | |
app.use(express.favicon()) | |
app.use(express.static(__dirname + staticPath)) | |
app.listen(port, function () { | |
console.log('Listening on port ', port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Maybe(value) { | |
this.value = value; | |
} | |
Maybe.Nothing = {}; | |
Maybe.pull = function (value) { | |
return new Maybe(value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// exception.js | |
var ObjectId = require('mongojs').ObjectId | |
, id = '000000000000000000000000'; | |
for (var i = 0; i < 1000000; i++) { | |
try { | |
var _id = ObjectId(id); | |
} catch (e) { | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% layout('../layout') -%> | |
<h2>This is the home page</h2> | |
<p><b>Message from contoller:</b> <%= message %></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var ejs = require('ejs-locals'); | |
var app = express(); | |
app.engine('ejs', ejs); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'ejs'); | |
require(__dirname + '/router')(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Node.js sample application</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="stylesheet" href="/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="/css/social-buttons.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
overflow-y: scroll; | |
} | |
body { | |
padding-top: 60px; | |
font-size: 13px; | |
} | |
section { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reader = fn (source) { | |
// fetch data from somewhere e.g. http server and emit result | |
this.emit('some data') | |
} | |
parser = fn (data) { | |
// parse and validate data and emit result | |
this.emit(parsedData) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// chrome | |
Object.keys(document) | |
.filter(function (i) { | |
return i.substring(0,2) == 'on' && (document[i] == null || typeof document[i] == 'function'); | |
}) | |
.map(function (e) { | |
return e.slice(2); | |
}) | |
.forEach(function (eventName) { | |
document.addEventListener(eventName, function (event) { |
OlderNewer