Skip to content

Instantly share code, notes, and snippets.

View apas's full-sized avatar

apas apas

View GitHub Profile
@apas
apas / graph paper.tex
Created February 6, 2017 12:30 — forked from mcnees/graph paper.tex
Make your own quadrille, graph, hex, etc paper! Uses the pgf/TikZ package for LaTeX, which should be part of any modern TeX installation.
%%-----------------------------------------------------------------------
%% Make your own quadrille, graph, hex, etc paper!
%% Uses the pgf/TikZ package for LaTeX, which should be part of
%% any modern TeX installation.
%% Email: [email protected]
%% Twitter: @mcnees
%%-----------------------------------------------------------------------
\documentclass[11pt]{article}
@apas
apas / Makefile
Created March 11, 2016 12:37 — forked from fasiha/Makefile
A pandoc custom writer targeting tufte-css HTML
test.html: test.md tufte-css.lua html5.html
pandoc -t tufte-css.lua -f markdown -c tufte.css --template html5.html test.md > test.html
html5.html:
pandoc -D html5 > html5.html
@apas
apas / netflix-genre-crawl.py
Created January 23, 2016 12:57 — forked from blech/netflix-genre-crawl.py
Fetch genre names from Netflix
#!/usr/bin/python
# TODO make range command line arguments
import sys, codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout) # if your terminal can't do utf-8, well...
import time
import urllib2
import BeautifulSoup
@apas
apas / nginx.conf
Last active September 16, 2015 15:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@apas
apas / latency.markdown
Created August 10, 2012 10:15 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

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  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs