Skip to content

Instantly share code, notes, and snippets.

View qrw's full-sized avatar
😀
i am happy

Rongwei Qian qrw

😀
i am happy
View GitHub Profile
@nihen
nihen / isucon2.psgi
Created November 3, 2012 08:56
isucon2
use 5.14.0;
use Plack::Request;
use IO::Handle;
use Encode;
use List::Util qw/sum/;
use POSIX qw/strftime/;
use JSON::XS;
my $json_encoder = JSON::XS->new->latin1;
my $json_decoder = JSON::XS->new->utf8;
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@mala
mala / memcachedos.pl
Created August 13, 2010 11:49
DoS for memcached
#!/usr/local/bin/perl
# DoS tool for memcached
# ulimit -n 15000; perl memcachedos.pl 127.0.0.1 11211 3
# original: http://gist.github.com/522741
# This is Public Domain Software
use strict;
use warnings;
use AnyEvent;