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'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'); | |
var app = express.createServer( | |
express.logger(), | |
express.bodyDecoder() | |
); |
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
/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.])(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\([^\s()<>]+\)|[^`!()\[\]{};:'".,<>?«»“”‘’\s]))/img |
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 css64Encode = function (string) { | |
return $.base64Encode(string). | |
replace(/\//g, '--_'). | |
replace(/\+/g, '-_'). | |
replace(/\=/g, '_'); | |
}; | |
var css64Decode = function (string) { | |
return $.base64Decode(string. | |
replace(/--_/g, '/'). |
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
// Usage: | |
// var file = fopen("/tmp/firefuck.txt"); | |
// file.writeString("Hello, sir. How are you?\n"); | |
// file.close(); | |
var fopen = function (path) { | |
try { | |
var file = Components.classes["@mozilla.org/file/local;1"]. | |
createInstance(Components.interfaces.nsILocalFile); | |
file.initWithPath(path); | |
var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]. |
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
" Change tabs to 2 spaces | |
:retab 2 | |
" Wrap the margin at 80 chars | |
:set wrapmargin=80 | |
" Show non-printable characters in Vim | |
:set list | |
" Interactive search and replace |
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
// Javascript Arrays already have: | |
// Array.indexOf | |
// Array.lastIndexOf | |
// Array.every | |
// Array.filter | |
// Array.forEach | |
// Array.map | |
// Array.some | |
Array.prototype.remove = function (from, to) { |