Skip to content

Instantly share code, notes, and snippets.

View szalansky's full-sized avatar
🎯
Focusing

szalansky

🎯
Focusing
View GitHub Profile
public void testCaseToString() {
// This test wins the award for twisted snake tail eating while
// writing self tests. And you thought those weird anonymous
// inner classes were bad...
assertEquals("testCaseToString(junit.tests.framework.TestCaseTest)", toString());
}
//
/**

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang ([email protected]). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl
class PeopleController < ApplicationController
before_filter :authenticate_user!, :except => [:index, :show]
...
end
@szalansky
szalansky / hash.rb
Created October 5, 2012 13:36 — forked from teamon/hash.rb
# Instead of:
# hash[:a].try(:[], :b).try(:[], :c).try(:[], :d)
# you can write
# hash[:a, :b, :c, :d]
class Hash
# h = {:a => {:b => {:c => 1}}}
# p h[:a] # => {:b => {:c => 1}}
# p h[:a, :b] # => {:c => 1}
# p h[:a, :b, :c] # => 1
@szalansky
szalansky / latency.txt
Created May 31, 2012 14:26 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns