Skip to content

Instantly share code, notes, and snippets.

@aysylu
aysylu / Measurement Bias Media List
Created May 7, 2015 16:01
List of media for learning more about measurement bias in system benchmarks
Talk: "We Have It Easy, But Do We Have It Right?"
-------------------------------------------------------
[https://www.youtube.com/watch?v=DKVRkfXrBpg]
Amer Diwan's talk at Google covering the topics in this paper and
other ideas.
"Why You Should Care About Quantile Regression"
@midwire
midwire / reset_routing_table.sh
Last active January 4, 2024 20:01
[Reset routing table on OSX] #osx #devops #networking
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@jboner
jboner / latency.txt
Last active April 19, 2024 23:08
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
Snippet development
Quickly finding snippets
There are some ways you can quickly find a snippet file:
*
M-x yas/new-snippet
Prompts you for a snippet name, then tries to guess a suitable directory to store it, prompting you for creation if it does not exist. Finally, places you in a new buffer set to snippet-mode so you can write your snippet.