Skip to content

Instantly share code, notes, and snippets.

@zmagg
zmagg / word_games.py
Last active December 21, 2015 02:38
hacker school mini improvised contest for the fastest solution to find what words are the longest anagrams of each other (single words, please, no phrases) in the sowpods scrabble dictionary.
f = open("sowpods.txt", "r")
canonized_words = {}
word1 = ""
word2 = ""
max_len = 0
for line in f:
if len(line) > max_len:
sorted_word = ''.join(sorted(line))
@zmagg
zmagg / GuavaCollection2
Created August 23, 2013 21:04
share guava test file.
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import static java.lang.System.out;
/**
syntax on
set number
filetype plugin on
set nocompatible
set modelines=0
filetype plugin indent on
syntax on
set expandtab
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# bash history
export HISTSIZE=20000
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
alias gdiff='gist -t diff'
@zmagg
zmagg / gist:03bfbe561d48326ffe0b
Created December 1, 2014 06:45
freud & lacan
freud --- civilization and its discontents
freud --- the new introductory lectures on psycho-analysis
lacan --- seminars (choose 2)
( a few other essays, TBD)
@zmagg
zmagg / gist:0f25e57f950dd2963ebd
Last active October 24, 2015 14:35
montreal recs
vegetarian friendly:
BAGELS (fairmount / st viateur)
arepera du plateau (delicious)
bangkok (thai food in a food court) maja knows a thai place that delivers though I think!
burritoville (adorable vegan place with sweet potato burritos and lemonade)
la panthere verte (my favorite falafels in montreal; mostly vegan). several locations.
omnivore (hummus and eggplant dips and tasty salads <3)
ice cream: MuuMuu and kem coba are both excellent.
indian food in park extension (bombay mahal or maison indian curry; they're across the street from each other)
@zmagg
zmagg / gist:e7307ea2adf6cd510e95
Created January 17, 2015 06:22
scaleconf proposal

Etsy started with a monolithic Postgres database and moved to a horizontally sharded MySQL store with a lookup table and master-master replication. Scaling your data store is never easy as just adding more hardware though, even with sharding.

In this talk, we'll go over the pains and perils of sharding databases and how we solved some of the problems in Etsy's second take on sharding, what we call logical sharding. Logical sharding is where we put several databases on one mysqld, as opposed to one database per server. Upon hitting a resource limit on a box (CPU, Memory, Connections, etc) that would normally require individual row migration, we can instead do file level migrations of a database, replicate, then drop previous databases, which is super fast and a cleaner way to delete old unnecessary shard data. We'll also go over how logical sharding benefits other daily operational challenges like schema changes and backups, as well as simplies life for developers and makes life easier for downstream data wa

@zmagg
zmagg / gist:133c4febd84dbab394af
Last active October 24, 2015 15:18
packing list for amsterdam, portugal
backpack
waterproof interior bag (i don't really need it, but maybe someone i'm traveling with will like it? also laundry)
raincoat
3 t-shirts
3 pairs of underwear (lol)
2 pairs of wool socks
2 pairs of cotton socks
one heavyish wool sweater (purple)
one light merino sweater (black)
one merino liner layer thin long sleeved (black)
@zmagg
zmagg / gist:10e2bcd383ae286dbe7e
Last active January 3, 2016 23:12
political theory reading, zmagg's list
nationalism & identity:
american foreign policy and its thinkers - perry anderson
Listening to Grasshoppers: Field Notes on Democracy. - arundathi roy
imagined communities -benedict anderson
Reproducing the State, Jacqueline Stevens
imperalism, arendt
general political theory:
18th brumaire, marx
@zmagg
zmagg / gist:ea26038d2b1227141bdc
Created November 27, 2015 16:34
zmagg's carnitas recipe
I sort of cobble together http://smittenkitchen.com/blog/2011/11/homesick-texan-carnitas/ with http://www.seriouseats.com/2010/07/the-food-lab-how-to-make-crisp-and-juicy-carnitas-without-a-bucket-of-lard.html.
Spices:
Half an orange, juiced.
Orange zest from half an orange.
Lime, cut in halves.
one stick cinnamon, in halves.
teaspoon Arizona Dreaming by Penzeys.
two dried chipotles
teaspoon coriander