This file contains hidden or 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
--- lib/log4js.js.orig 2011-03-04 10:32:06.000000000 +0900 | |
+++ lib/log4js.js 2011-03-04 10:42:24.000000000 +0900 | |
@@ -134,8 +134,8 @@ | |
args = [ ALL_CATEGORIES ]; | |
} | |
//argument may already be an array | |
- if (args[0].forEach) { | |
- args = args[0]; | |
+ if (args[0].constructor.name === 'Array') { | |
+ args = args[0]; |
This file contains hidden or 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 os = require('os'); | |
var osType = os.type(); | |
var search = function() {}; | |
if (osType === 'Darwin') { | |
var nic = 'en0'; // Mac OSX |
This file contains hidden or 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
--- lib/ws/connection.js.orig 2011-03-31 16:43:40.000000000 +0900 | |
+++ lib/ws/connection.js 2011-03-31 16:45:33.000000000 +0900 | |
@@ -182,10 +182,10 @@ | |
/*----------------------------------------------- | |
Various utility style functions: | |
-----------------------------------------------*/ | |
-function write(connection, data) { | |
+function write(connection, data, encoding) { | |
debug(connection.id, 'write: ', (new Buffer(data)).inspect()); | |
if (connection._socket.writable) { |
This file contains hidden or 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
#! /bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
This file contains hidden or 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 io = require('socket.io').listen(8081); | |
var parser = require('socket.io').parser; | |
io.sockets.on('connection', function(socket) { | |
var pre; | |
var i = 0; | |
io.transports[socket.id].parser.on('data', function(p) { | |
var packet = parser.decodePacket(p); | |
if(packet.type === 'heartbeat') { | |
if(global.gc) global.gc(); | |
var memoryUsage = process.memoryUsage(); |
This file contains hidden or 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
# this program uploads to google storage using boto and eventlet all the jpg files of a selected folder | |
import eventlet | |
bcon = eventlet.import_patched("boto.gs.connection") | |
import glob | |
FOLDER = "/Users/myself/Documents/" # replace this with your chosen folder | |
BUCKET_NAME = "whateveryourbucketname" # replace this with your bucket name | |
def upload(myfile): | |
c = bcon.GSConnection() |
This file contains hidden or 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 python | |
from __future__ import with_statement | |
import contextlib | |
import logging | |
import os | |
import sys | |
import urllib2 | |
from boto.ec2.connection import EC2Connection |
This file contains hidden or 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
{ | |
/* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
* | |
* To use: copy this file to ~/Library/KeyBindings/ | |
* after that any Cocoa applications you launch will inherit these bindings | |
* | |
* This is a pretty good set, especially considering that many emacs bindings | |
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
* perhaps a few more, are already built into the system. | |
* |
This file contains hidden or 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
>>> items = [1,2,3,4,5] | |
>>> if 3 in items: print "hit!!" | |
... | |
hit!! |
This file contains hidden or 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
>>> list1, list2 = [1,2,3,4,5], [6,7,8,9,10] | |
>>> for (e1, e2) in zip(list1, list2): print e1, e2 | |
... | |
1 6 | |
2 7 | |
3 8 | |
4 9 | |
5 10 |
OlderNewer