Skip to content

Instantly share code, notes, and snippets.

@yaniv-aknin
yaniv-aknin / keybase.md
Created January 20, 2015 16:40
keybase.md

Keybase proof

I hereby claim:

  • I am yaniv-aknin on github.
  • I am yanivaknin (https://keybase.io/yanivaknin) on keybase.
  • I have a public key whose fingerprint is 0793 D8DB D227 5338 920F 5D1A 40D0 78BF 34E4 2A6E

To claim this, I am signing this object:

@yaniv-aknin
yaniv-aknin / gist:7d285f9b1dc2fb91e013
Last active August 29, 2015 14:21
Some thoughts on communications

I posted this internally at Google, someone asked me to post it externally. To be frank, I almost didn't write it because it seemed so obvious. But isn't that the point? What's obvious to you might not be to others. So I'm happy to oblige.

Maybe this is obvious, maybe this is so generic that it's useless, but I feel it has to be written somewhere.

The time you spend on communicating something (writing a doc, an email, a bug, a comment, ...) should be proportional to the "distance" of the person receiving the message.

Distance varies on three axes I can think of:

  • Physical: This one is obvious, but requires some explanation. If someone is far away from you, your bandwidth is hugely limited already. You speak to them less often, they don't get your body language, they don't get your tone, they don't get you. Make things easy for them.
  • Subject matter: The less someone knows about (your project, this topic, your likely state of mind), the more you should explain. Good communication is a lot about empat
@yaniv-aknin
yaniv-aknin / brew-python3
Created January 16, 2011 15:19
Brew build errors for Python 3
$ brew install python3
==> Downloading http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python3/3.1.3 --with-computed-gotos --enable-shared
==> make
/usr/bin/cc -c -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline/6.1/include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
/usr/bin/cc -c -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline/6.1/include -DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
/usr/bin/cc -c -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline/6.1/include -DPy_BUILD_CORE -o Parser/grammar1.o Parser/grammar1.c
/usr/bin/cc -c -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline
@yaniv-aknin
yaniv-aknin / pyrocfile.py
Created February 9, 2012 09:39 — forked from asenchi/pyrocfile.py
pyrocfile - 100 line Procfile manager in Python
# Pyrocfile - Simple Python impementation of Procfile manager
# Written by Chris Testa (http://testa.co/) in 2011
# Released in the Public Domain
import argparse, logging, os.path, random, re, select, signal, subprocess
def _new_logger(name, color=None):
logger = logging.getLogger(name)
hdlr = logging.StreamHandler()
color, end_color = '\033[9%dm' % (color or random.randint(1, 6)), '\033[0m'
@yaniv-aknin
yaniv-aknin / muroku.py
Created April 3, 2012 09:50
muroku: small utility to aid syncing staging/testing/live heroku environments
#!/usr/bin/env python
# Written by @aknin
# https://gist.github.com/gists/2290744
# This code has been placed in the public domain, no strings attached either way.
from __future__ import print_function
import platform
import os
@yaniv-aknin
yaniv-aknin / heroku-dupdb.sh
Created April 14, 2012 18:18
heroku-dupdb: small utility to clone a database between two apps, useful for copying production into staging
#!/usr/bin/env bash
cprint () {
printf "%b" "\e[1;37m${1}\e[0m\n"
}
usage() {
cat << EOF
usage: $0 [OPTIONS] <src> <dst>
--confirm <dst> dont ask for confirmation before destroying and restoring into <dst>
% heroku apps:create -s cedar restpaste
Creating restpaste... done, stack is cedar
http://restpaste.herokuapp.com/ | git@heroku.com:restpaste.git
Git remote heroku added
% heroku addons:remove shared-database:5mb
! WARNING: Potentially Destructive Action
! This command will affect the app: restpaste
! To proceed, type "restpaste" or re-run this command with --confirm restpaste
@yaniv-aknin
yaniv-aknin / requirements.txt
Created April 23, 2012 17:31
s3lint: a simple lint tool to update S3 content-type and cache-control headers
boto==2.3.0
gevent==0.13.7
greenlet==0.3.4
wsgiref==0.1.2
@yaniv-aknin
yaniv-aknin / gist:3047862
Created July 4, 2012 15:19
Dirtys: shell function for a quick-and-dirty Redis instance
dirtys () {
if ! which redis-server > /dev/null
then
echo no redis, no dirtys
return 1
fi
redis-server - <<EOF
timeout 0
logfile stdout
databases 1
@yaniv-aknin
yaniv-aknin / gist:3075120
Created July 9, 2012 08:35
odd coffeescript 1.3.3 behaviour with superflous indentation on first line
$ cat > ok.coffee
1
2
$ cat > bad.coffee
1
2
$ coffee -cs < ok.coffee
// Generated by CoffeeScript 1.3.3
(function() {
1;