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
And if you survive till two thousand and five | |
I hope you're exceedingly thin | |
For if you are stout you will have to breathe out | |
While the people around you breathe in |
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 connect = require('connect'); | |
var redisFactory = require('redis-node'); | |
var redis = redisFactory.createClient(); | |
var server = connect.createServer(); | |
// test with: ab -n 5000 -c 40 http://127.0.0.1:3000/folders | |
function buffer_to_strings(x) { | |
for(var i in x) { |
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.html; lynx -dump http://redis.io/commands | awk '/commands/{print $2}' | while read i; do j=${i##*/}; (echo "<h1>$j</h1>"; curl $i | sed -n -e '/<aside>/,/<\/aside>/d' -e '/<article>/,/<\/article>/p'; echo "<hr>") >> test.html; sleep 1; done |
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
use Template; | |
use Template::Parser; | |
my $p = Template::Parser->new(); | |
my $tt = join('', <DATA>); | |
print $p->parse($tt) ? "OK" : "NOT OK"; | |
__DATA__ | |
[% INCLUDE monkeys %] | |
<ul> |
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 ! git status >/dev/null 2>/dev/null ; then | |
echo "not a git repository" | |
exit 128 | |
fi | |
B=/tmp/.lnt.branches | |
T=/tmp/.lnt.tracking | |
# first we find our local branches | |
git branch --no-abbrev --no-color | cut -b3- | sort > $B | |
# do we have any remotes? | |
rc=$(git remote | wc -l) |
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
del folder:mince | |
del folder:opensource | |
del user:rjp:read | |
zadd folder:mince 12345 23 | |
zadd folder:mince 12346 24 | |
zadd folder:opensource 12345 25 | |
zadd folder:mince 12349 26 | |
zadd user:rjp:read 12345 23 | |
zadd user:rjp:read 12345 25 | |
echo "should be 2" |
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 'rubygems' | |
require 'redis' | |
$redis = Redis.new() | |
$redis.select(3) | |
# do a zdiffstore only on scores that match | |
# ie [23:12345] will only be removed by [23:12345], not [23:12350] | |
def zdiffstore(x, y) | |
$redis.zunionstore "tmp.zu", [x, y], :weights=>[1,-1], :aggregate=>:sum |
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 l = [ | |
{ unread: 4, sub: 1 }, | |
{ unread: 0, sub: 1 }, | |
{ unread: 4, sub: 0 } | |
]; | |
filters = process.env.filter; if (filters == undefined) { filters = ""; } |
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
awk -F\\t 'BEGIN{print"%html\n %body\n %table\n %tr\n %th Track\n %th Artist\n %th Album"}{printf(" %%tr\n %%td %s\n %%td %s\n %%td %s\n",$1,$3,$4)}' | recode utf8..html | haml |
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 'rubygems' | |
require 'json' | |
require 'open-uri' | |
$base = ENV['UA_BASE'] || 'http://localhost:3000' | |
$user = ENV['UA_USER'] || 'user' | |
$pass = ENV['UA_PASS'] || 'pass' | |
# {"folder":"test2","to":"rjp","id":2035015,"body":"FLANGES","inReplyTo":2034051,"subject":"Ainsley","epoch":1298383425,"read":false,"annotations":[{"body":"*mutter*","epoch":1298384919,"from":"rjp"}],"from":"rjp","inReplyToHierarchy":[{"folder":"test1","id":2034051,"from":"rjp"}],"replyToBy":[{"folder":"test1","id":2035371,"from":"rjp"}]} |