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
function decodeUTF(x, z) { | |
return x.replace(/%([cd][0-9a-f]%[89ab][0-9a-f]|e[0-9a-f](?:%[89ab][0-9a-f]){2}|f[0-7](?:%[89ab][0-9a-f]){3}|f[89ab](?:%[89ab][0-9a-f]){4}|f[cd](?:%[89ab][0-9a-f]){5})/ig, function(a) { | |
return z ? '&#' + decodeURIComponent(a).charCodeAt(0) + ';' : decodeURIComponent(a); | |
}); | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main() { | |
execl("/usr/bin/osascript", "osascript", | |
"-e", "tell the application \"iTunes\" to get (the name of current track) & \" ----- \" & (the artist of current track) as string", NULL); | |
return 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
#include <stdio.h> | |
#include <sndfile.h> | |
#include <string.h> | |
// gcc topcm.c -lsndfile -o topcm | |
int main(int argc, char **argv) { | |
if (argc < 3) { | |
printf("Usage: %s in-filename out-filename\n", argv[0]); return 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
var asyncLoop = function(init, cond, next, body, fin) { | |
init(); | |
if (cond()) body(function cont() { | |
next(); if (cond()) body(cont); else if (fin) fin(); | |
}); | |
}; | |
var asyncSeq = function() { | |
var i, args = arguments; |
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
require('https').get({ | |
host: 'raw.github.com', | |
path: '/twitter/twitter-text-js/master/twitter-text.js' | |
}, function(res) { | |
var buf = ''; | |
res.setEncoding('utf-8'); | |
res.on('data', function(d) { buf += d }); | |
res.on('end', function() { gen(buf); }); | |
}); |
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
<?php | |
$events = array(); | |
$e = array(); | |
foreach (file($argv[1]) as $v) { | |
$l = explode(', ', trim($v)); | |
$time = (intval($l[1]) / 96) * 60 / 160; | |
$ms = floor($time * 1000); | |
if ($l[2] == 'Note_off_c' || ($l[2] == 'Note_on_c' && $l[5] == '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
var fluidHoster = window; | |
var fluidIframe = null; | |
var fluidQueuedText = null; | |
function setDockBadge(text) { | |
if ('fluid' in window) { | |
try { | |
if (fluidHoster == null) { | |
fluidQueuedText = text; | |
} else { | |
fluidHoster.fluid.dockBadge = text; |
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 cp = require('child_process'); | |
exports.notify = function(appName, message) { | |
var g = cp.spawn('growlnotify', [ | |
'-n', appName, | |
'-s', | |
'-m', message, | |
'-p', '2' | |
]); | |
g.stdin.end(); |
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
.notification-area > div[style] > div[style] { | |
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAATCAYAAACZZ43PAAAAQElEQVQ4jc2UMREAQAyD8FRP76lq8w6SMR3YOEZgnhwCC0k4EFgPSTgQkIck9AMTIAn9ACtPFOqBNx6S0A+kY30pBObP4JSXugAAAABJRU5ErkJggg==) center right !important; | |
text-shadow: 1px 1px 0 black, 1px 0px 0 black, 1px -1px 0 black, | |
0px 1px 0 black, 0px -1px 0 black, -1px 1px 0 black, | |
-1px 0px 0 black, -1px 0px 0 black, 2px 2px 1px black; | |
color: white !important; | |
} |
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
each_dir() { | |
COMMAND="$1" | |
for I in */* | |
do | |
if [ -d "$I" ]; | |
then | |
"$COMMAND" "$I" | |
fi | |
done | |
} |