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
select | |
/* Image Filetypes */ | |
when match(1,'FFD8FFE00010'x'JFIF') then ftype = 'JPEG' | |
when match(1,'GIF8') then ftype = 'GIF' | |
when match(2,'PNG') then ftype = 'PNG' | |
when match(1,'0a0501'x) then ftype = 'PCX' | |
when match(9,'ILBM') & form then ftype = 'ILBM' |
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
#!/usr/bin/env node | |
// | |
// Lame Ident Daemon for IRC | |
// | |
// (c) 2010 George Stagakis | |
// | |
// MIT Licenced | |
// |
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 net = require('net') | |
, config = { | |
type: 'text/plain' | |
} | |
exports.send = function(options, cb) { | |
var stream = net.createConnection(options.port, options.host) | |
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
// bit compressors for everyone | |
// by stagas | |
// public domain | |
var bitEncodeUTF8 = function(bits) { | |
var arr = [] | |
while (bits.length) { | |
arr.push(String.fromCharCode(parseInt('1' + bits.substr(0, 15), 2))) | |
bits = bits.substr(15) | |
} |
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
// another bit compressor | |
// by stagas | |
// public domain | |
var bitEncode = function(bits) { | |
var arr = [] | |
while (bits.length) { | |
arr.push(String.fromCharCode(parseInt('1' + bits.substr(0, 15), 2))) | |
bits = bits.substr(15) | |
} |
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
// bit compressor | |
// by stagas | |
// public domain | |
var bitEncode = function(bits) { | |
var arr = [] | |
while (bits.length) { | |
arr.push(parseInt('1' + bits.substr(0, 52), 2).toString(32)) | |
bits = bits.substr(52) | |
} |
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
if (secured || !store.cookie.secure) { | |
// Send an updated cookie to the browser | |
store.cookie.expires = typeof store.cookie.persistent === 'undefined' || store.cookie.persistent ? new Date(Date.now() + store.maxAge) : null; | |
// Multiple Set-Cookie headers | |
headers = headers || {}; | |
var cookie = utils.serializeCookie(key, req.sessionID, store.cookie); | |
if (headers['Set-Cookie']) { | |
headers['Set-Cookie'] += '\r\nSet-Cookie: ' + cookie; | |
} else { |
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(req, res, next) { | |
var ip = req.headers.ip | |
if (typeof banned[ip] !== 'undefined') { | |
if (Date.now() - banned[ip] > 3 * 60 * 60 * 1000) { | |
try { | |
delete banned[ip] | |
} catch(e) {} | |
log('UNBANNED:'.cyan, ip) | |
} else { |
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 sys = require('sys') | |
var o = {} | |
, bo = [] | |
for (var i=1000000; i--; ) { | |
bo.push('123456789012345678901234567890') | |
} |
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
{ message: 'Parse Error', | |
stack: [Getter/Setter], | |
bytesParsed: 21260 } [ ' at Client.onData [as ondata] (http.js:889:27)', | |
' at Client._onReadable (net.js:762:27)', | |
' at IOWatcher.onReadable [as callback] (net.js:276:10)' ] |