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
processor.emit = function() { | |
var event = arguments[0]; | |
var value = arguments[1]; | |
//emit original event | |
self.emit(event, value); | |
//rewrite to new alias | |
for(var i in MAPPINGS){ | |
var current = MAPPINGS[i]; | |
if(current.from.indexOf(event) > -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
var fs = require('fs'), | |
walk = require('walk'), | |
path = require('path'), | |
mm = require('musicmetadata'); | |
walker = walk.walk('/Users/leetreveil/Music/Mine', { followLinks : false }); | |
walker.on('file', function(root, fileStats, next) { | |
if (/^.*\.(mp3|m4a|flac|ogg)/.test(fileStats.name)) { | |
var fullPath = path.join(root, fileStats.name); |
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
git filter-branch -f --env-filter 'if [[ "$GIT_COMMIT" = "119900cd7054c64f2b8e4774e59afbfc39a28e73" ]]; then export GIT_COMMITTER_NAME="Lee Treveil" GIT_AUTHOR_NAME="Lee Treveil" GIT_COMMITTER_EMAIL="[email protected]" GIT_AUTHOR_EMAIL="[email protected]"; fi' HEAD |
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
wchar_t* command = L"my command"; | |
int len = wcslen(command) + 1; | |
wchar_t* w_msg = (wchar_t*)malloc(sizeof(wchar_t) * len); | |
wcscpy(w_msg, command); | |
free(w_msg); |
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
test: test.obj | |
g++ test.o -o kdssvolumeinfo_node.node -L/usr/local/lib $(KDSS_SLIB_NAME) -shared | |
test.obj: | |
g++ $(CPPLAGS) $(CFLAGS) -g -fPIC -DPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DEV_MULTIPLICITY=0 $(INCLDIRS) -I/usr/local/include/node kdssvolumeinfo_node.cpp -c -o test.o |
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
#!/bin/bash | |
# usage: time benchbulk.sh dbname | |
# it takes about 30 seconds to run on my old MacBook | |
BULKSIZE=1000 | |
DOCSIZE=100 | |
INSERTS=10 | |
ROUNDS=10 | |
DBURL="http://localhost:5984/$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
var http = require('https'); | |
var musicmetadata = require('musicmetadata'); | |
http.get('https://dl.dropbox.com/u/1269592/Into%20The%20Back%20%28WORNG%20Remix%29.mp3', function (res) { | |
var parser = new musicmetadata(res); | |
parser.on('metadata', function (result) { | |
console.log(result); | |
}); | |
parser.on('done', function (err) { | |
if (err) throw err; |
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
#!/bin/bash | |
# shell script to create a simple mongodb replica set (tested on osx) | |
set -e | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
default=$(tput sgr0) |
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
""" List duplicate celery tasks in redis queues """ | |
import datetime | |
import redis | |
import json | |
import base64 | |
import pickle | |
from collections import Counter | |
import argparse | |
import sys |
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 musicmetadata = require('musicmetadata'); | |
addDragDropListener(document, function (files) { | |
musicmetadata(files[0], { duration: true }) | |
.on('metadata', function (result) { | |
console.log(result); | |
if (result.picture.length > 0) { | |
var picture = result.picture[0]; | |
var url = URL.createObjectURL(new Blob([picture.data], {'type': 'image/' + picture.format})); | |
var image = document.createElement('img'); |
OlderNewer