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'), | |
UPLOAD_LIMIT = 1000000, | |
flconf = {"uploadRootDir": '/tmp/', "requestTimeOut": 600000, "resumeRequestOnError": false, "maxFileSize": UPLOAD_LIMIT, "checkContentLength": true, "holdFilesExtensions": true, "removeIncompleteFiles": true, "logging": 'debug:off,1:on,2:off,3:off,4:off,console:on,file:off,record:off'}, | |
formaline = require('connect-formaline'); | |
connect( | |
connect.cookieParser(), | |
connect.session({ secret: 'keyboard cat' }), | |
formaline(flconf), | |
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
#!/usr/bin/env node | |
var express = require('express'), | |
app = express.createServer(), // actual application | |
UPLOAD_LIMIT = 20 * 1024 * 1024, | |
form = require('./connect-formaline'), | |
formaline_config = ({"uploadRootDir": '/tmp/', "emitProgress": true, "requestTimeOut": 600000, "resumeRequestOnError": false, "maxFileSize": UPLOAD_LIMIT, "checkContentLength": true, "holdFilesExtensions": true, "removeIncompleteFiles": true, "logging": 'debug:on,1:on,2:on,3:off,4:off,console:on,file:off,record:off'}); | |
app | |
.use(express.cookieParser()) |
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
formaline, event "message" --> {"type":"warning","isupload":true,"msg":"unable to retrieve session identifier, configuration parameter me.getSessionID must be a function!"} | |
formaline, HTTP Request Headers : { | |
"host": "domain.com", | |
"user-agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0", | |
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", | |
"accept-language": "en-us,en;q=0.5", | |
"accept-encoding": "gzip, deflate", | |
"accept-charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", | |
"connection": "keep-alive", | |
"referer": "http://domain.com/test.html", |
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
description "redis server" | |
start on runlevel [2345] | |
stop on shutdown | |
exec /usr/local/bin/redis-server /etc/redis/redis.conf | |
respawn |
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 dgram = require('dgram'); // dgram is UDP | |
// Listen for responses | |
function listen(port) { | |
var server = dgram.createSocket("udp4"); | |
server.on("message", function (msg, rinfo) { | |
console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.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
var oldDate = Date; | |
Date = function () { | |
var args = arguments.length > 0 ? Array.prototype.slice.call(arguments) : [1293861600]; | |
if (typeof args[0] === 'string') { | |
args = ["'" + args[0] + "'"]; | |
} | |
return new Function('return new oldDate(' + args.join(',') + ');')(); | |
} |
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
➜ ~ brew --config | |
HOMEBREW_VERSION: 0.9.4 | |
ORIGIN: https://github.com/mxcl/homebrew | |
HEAD: bf31154f700a73c5c14b96edf447e75964e9390d | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: 8-core 64-bit ivybridge | |
OS X: 10.8.3-x86_64 | |
Xcode: 4.6.1 | |
CLT: 4.6.0.0.1.1362189000 |
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
require('http').Server(function (req, res) {}) | |
.listen(28423, '127.0.0.1', function () { | |
var request = require('request') | |
request({ | |
"method": "GET", | |
"uri": "http://127.0.0.1:28423", | |
"timeout": 1000 | |
}).on('error', function(e){ | |
console.log('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
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" | |
PROMPT='%{$fg[blue]%}%n@%m ${ret_status}%{$fg_bold[green]%}%p%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
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 replicaSet = { | |
"collection" : "express_sessions", | |
"stringify": false, | |
"db": { | |
"name" : "sessions", | |
"replicaSetOptions": { | |
rs_name: 'default', | |
w: 2 | |
}, | |
"servers" : [ |
OlderNewer