Skip to content

Instantly share code, notes, and snippets.

View aliostad's full-sized avatar
I may be slow to respond.

Ali Kheyrollahi aliostad

I may be slow to respond.
View GitHub Profile
beyond-code-github / gist:5142264
Last active December 14, 2015 20:09
Very simple example of hierarchical route generation in web api
// Base route
config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional });
// Nested route (must be distinguishable by param names from above) - Deisgnated by leading _
config.Routes.MapHttpRoute("NestedRoute", "_/{controller}/{rootId}");
// Root controller signature:
public class AppDataController : ApiController
gregoryyoung / gist:5917423
Last active December 19, 2015 07:18
Proof that httplistener does not use http.sys kernel caching
From HttpListener source code
line 525
mugli /
Created January 30, 2014 21:51
Silently install Oracle Java 7 on Ubuntu (without license agreement step)
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
# Enable silent install
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
jboner / latency.txt
Last active July 22, 2024 14:44
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