Skip to content

Instantly share code, notes, and snippets.

View kablamo's full-sized avatar
🍨
wish i was eating ice cream instead

Eric Johnson kablamo

🍨
wish i was eating ice cream instead
View GitHub Profile
# Starlet
Concurrency Level: 8
Time taken for tests: 2.144 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 41378274 bytes
HTML transferred: 40008000 bytes
Requests per second: 4665.05 [#/sec] (mean)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jboner
jboner / latency.txt
Last active November 19, 2024 11:10
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@throughnothing
throughnothing / parks.pl
Created April 30, 2012 03:50
spark clone in perl
#!/usr/bin/env perl
# parks - spark clone in perl (https://github.com/holman/spark)
# Alternatives: https://github.com/holman/spark/wiki/Alternative-Implementations
# Wicked Cool Examples: https://github.com/holman/spark/wiki/Wicked-Cool-Usage
use List::Util qw( min max ); local $/;
my ($t, @n) = ( [qw(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)], -t STDIN ? @ARGV : split ' ', <STDIN> );
print map($t->[ int( ( $_ - min(@n) ) / max(@n) * $#$t ) ], @n), "\n";
#!/usr/bin/perl
use Cache::Memcached;
use YAML;
use YAML::Dumper;
print YAML::Dumper->new->dump(
Cache::Memcached->new( servers => [ "localhost:11211" ] )
->get( shift )
);