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
#! ruby | |
require "eregex" | |
@patterns = Hash.new | |
@keys = [] | |
def path(dir, group=nil) | |
if (dir.is_a? String) then | |
dir = Regexp.escape(dir) |
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 mongoose = require('mongoose').Mongoose | |
mongoose.model('User', { properties: ['name'] }) | |
var db = mongoose.connect('mongodb://localhost/db'); | |
db.addListener('error',function (error){ | |
throw error | |
}) |
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
console.log("GLOBALS!") | |
var assert = require('assert') | |
this.hello = 'sdgfasdgaghasdg' | |
assert.ok(global === this,'expected global === this') | |
assert.equal(this.hello , hello) | |
y = 'MVOISMDFOVISR' | |
assert.equal(this.y , 'MVOISMDFOVISR') |
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
console.log("process.version = " + process.version ) | |
console.log("module = ") | |
console.log(module) | |
console.log("process.mainModule = ") | |
console.log(process.mainModule) | |
console.log("require.main = ") | |
console.log(require.main) |
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 assert = require('assert') | |
var s = 'var assert = require(\'assert\')\n' | |
for(var i in assert){ | |
s += (ok.toString().replace(/ok/g,i)) + '\n' | |
} | |
function ok (){ | |
assert.ok.apply(null,arguments) | |
} |
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
// run with the following command: node test-node.js | |
var minimal = require("../minimal-node"); | |
var $m = minimal.template("<html><head><title></title><body><p id='content'></p></body></html>"); | |
$m({ | |
title: "some title", | |
unknown: "not in template" | |
}); |
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 http = require('http'), | |
fs = require('fs'), // to load html/js templates | |
window = require("jsdom").jsdom().createWindow(), // DOM/BOM | |
jQuery = require('jquery'), // for selectors | |
$p = require('pure').$p//FIX | |
templates = {}; | |
http.createServer(function (req, res) { | |
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 connect = require('connect') | |
, httpProxy = require('http-proxy') | |
//when a host:port/couch request comes in, remove /couch from url and proxy to host:5984 | |
function couch (req,res,next){ | |
console.log(req.url) | |
req.url = req.url.replace(/^\/couch/,'') || '/' | |
console.log(req.url) |
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 http = require('http'), | |
httpProxy = require('http-proxy'), | |
request = require('request') | |
// Create your proxy server | |
var proxied = | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2)); | |
res.end(); |
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
[api]: New apis / changes to apis | |
[test]: Update test/* files | |
[dist]: Changes to submodules, version bumps, updates to package.json | |
[minor]: Small changes | |
[doc]: Updates to documentation | |
[ux]: Updates to UX | |
[fix]: Bug fixes | |
[bin]: Update binary scripts associated with the project | |
[merge]: Resolved git merge from upstream or otherwise | |
[refactor]: Refactor of existing code with no external API changes |