Skip to content

Instantly share code, notes, and snippets.

@ageis
ageis / openpgp-card-guide.md
Last active December 11, 2023 09:36
Quick GPG Smartcard Guide
@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

From 59fc7da8ea7be513f452c82a808cbe125ea0dc96 Mon Sep 17 00:00:00 2001
From: Vladimir Pouzanov <farcaller@gmail.com>
Date: Fri, 25 May 2012 14:28:16 +0300
Subject: [PATCH 1/4] Added basic support for gems
---
gem.rb | 3 +++
gem/manager.rb | 15 +++++++++++++++
gem/motion_spec.rb | 18 ++++++++++++++++++
gem/specification.rb | 10 ++++++++++
/*
* More info at: http://phpjs.org
* http://phpjs.org/functions/index
*
* php.js is copyright 2009 Kevin van Zonneveld.
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Conversion to Objective-J copyright 2009 Philippe Laval
* Licenced under the same MIT, GPL dual licences.
@BinaryMuse
BinaryMuse / 00_rvm.sh
Created January 30, 2011 05:17
DND - blog post
# Install RVM and dependencies
sudo aptitude install curl git-core
sudo bash < <( curl -L http://bit.ly/rvm-install-system-wide )
sudo aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev
sudo adduser `whoami` rvm
echo 'source /usr/local/lib/rvm' >> ~/.bashrc
# Set up users and groups
sudo useradd --home /var/www --create-home --groups rvm unicorn && sudo chmod g+w /var/www
sudo adduser `whoami` unicorn
#
@farcaller
farcaller / gist:666855
Created November 7, 2010 21:18
Python one-liner to count words in a string
> s = 'foo bar baz baz'
> reduce(lambda x,y:dict([ (k, (lambda a,b,k:(a[k] + (1 if k in b else 0)))(x,y,k)) for k in x.keys()]+[ (k,1) for k in y.keys() if not k in x ]), map(lambda x: {x:1}, s.split()))
{'bar': 1, 'baz': 2, 'foo': 1}
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>