Skip to content

Instantly share code, notes, and snippets.

View ddasilva's full-sized avatar

Daniel da Silva ddasilva

View GitHub Profile
@h4
h4 / env.py
Last active November 5, 2024 12:59
Setup alembic to work properly with PostgreSQL schemas
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from models import Base
config = context.config
fileConfig(config.config_file_name)
anonymous
anonymous / makey_makey.js
Created December 27, 2012 04:18
// requires jquery, buzz.js
$(document).ready(function() {
var mySound = new buzz.sound( "/sounds/teen-liver", {
formats: [ "ogg", "mp3", "acc", "wav" ]
});
var mySound2 = new buzz.sound( "/sounds/teen-liver", {
formats: [ "ogg", "mp3", "acc", "wav" ]
@usure
usure / test
Created July 18, 2012 23:57
test
test
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
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