Skip to content

Instantly share code, notes, and snippets.

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

FrankWangBlock frankzwang

💭
I may be slow to respond.
  • San Francisco, CA, USA
View GitHub Profile
@frankzwang
frankzwang / jwthelper.js
Last active August 29, 2015 14:27 — forked from ChrisRisner/jwthelper.js
JwtHelper.js
var crypto = require('crypto');
var iterations = 1000;
var bytes = 32;
exports.createSalt = function() {
return new Buffer(crypto.randomBytes(bytes)).toString('base64');
}
exports.hash = function hash(text, salt, callback) {
crypto.pbkdf2(text, salt, iterations, bytes, function(err, derivedKey){
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
http://www.depesz.com/2011/12/02/the-secret-ingredient-in-the-webscale-sauce/
http://www.craigkerstiens.com/2012/11/30/sharding-your-database/
https://github.com/markokr/pghashlib
http://www.niwi.be/2013/03/06/table-partitioning-with-postgresql/
https://blog.engineyard.com/2013/scaling-postgresql-performance-table-partitioning
http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram
http://instagram-engineering.tumblr.com/post/40781627982/handling-growth-with-postgres-5-tips-from-instagram
http://media.postgresql.org/sfpug/instagram_sfpug.pdf