I hereby claim:
- I am mrben on github.
- I am mrben (https://keybase.io/mrben) on keybase.
- I have a public key whose fingerprint is 9B13 54F9 37F7 AF9E 6F36 A775 909C F8A8 2B93 2633
To claim this, I am signing this object:
from decimal import Decimal | |
class Weight(object): | |
""" | |
Store and convert between weights. | |
>>> me = Weight(st=13) | |
>>> me | |
Weight(st=13.0) | |
>>> me.kg |
def calc_ean_13_checksum(ean): | |
import math | |
sum = 0 | |
for x, c in enumerate(str(ean)[::-1]): | |
if (x+1) % 2 == 0: | |
sum += int(c) | |
else: | |
sum += int(c) * 3 | |
return int(math.ceil(sum / 10.0) * 10) - sum |
# Setup Python, postgres and Python Imaging on Mac OS X 10.7.1 (Lion) Build 11B26. | |
sudo easy_install pip | |
sudo pip install psycopg2 | |
# Install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" | |
brew install wget |
# Using -f- for grep lets you type in a search on STDIN for stuff | |
# like passwords without saving in history or ps | |
grep -r -f- sourcecode/ |
import string | |
def caesar_shift(s, shift): | |
t = string.maketrans( | |
string.lowercase + string.uppercase, | |
string.lowercase[shift:] + string.lowercase[:shift] + string.uppercase[shift:] + string.uppercase[:shift] | |
) | |
return s.translate(t) | |
def rot_13(s): |
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAvSWMxjkPlQ6ti856EO+XDjc6ljWwtQn2h94l2uxtk/sSBXSrTWPCOhW7rTpyV8pCYok0Pa32YmK5lLztCHu5newKIKJC9zliNU2Yp4hE/ioOE+tPcx++ztyeFv7lyOjzUPVV6UzaoylUVpujSSHVCmLFnec/6W9Lhmo7hN8HV9xv7frN6a6IQ/TNCv6+HR8+pq+zwYQu5hU2+vpk+PhrMhlWr6A0c3XtfBle5nYaH9X+2oe5iMKGshR2xDTrBVeOtXg3AkaF4w5lID/3iyYRX2xLTOSM3nPYsGab+b6lvlge4H6/OWBosib9+LBAVxJvHINIiv+uAH8haLOTTOHfj7Rj2XpVCGgUMqzf53N2Q8+YWDaL3kMhwKXQmT3vr9n/pQqM7RNoRW6GpG6rPkc6H57W1LMJ5mSA42CfzkLsUQY3QutncWCN/qks7DYvaVJZft2JWSZnjaNAJyodZa1GWksW7EFLq6ZOKJsXSxwHNVD+bozQuz1S4h450OJKtOBLqJeAJMgUjPsRNrL/mb5zT3WcNz5QAfXYq6aK20x+wZNIVZlvLespbTHmv928vJHmsfjfZYvSfgYuPlhGxBfB3EEHqwMWfhufV9SRGnVz6CYujDjLU5oL0KGb2VjN7jgx8sol0jinKUD6VMLydGtwDwe1E2v8xSn+cNHQc13Jgns= [email protected] |
github "alfred", "1.0.3", :repo => "mrben/puppet-alfred" | |
github "chrome", "1.1.0", :repo => "boxen/puppet-chrome" | |
github "dropbox", "1.1.0", :repo => "mrben/puppet-dropbox" | |
github "iterm2", "1.0.0", :repo => "boxen/puppet-iterm2" | |
github "onepassword", "1.0.1", :repo => "mrben/puppet-onepassword" | |
github "osx", "1.2.0", :repo => "mrben/puppet-osx" | |
github "sublime_text_2", "1.1.0", :repo => "boxen/puppet-sublime_text_2" | |
github "vlc", "1.0.1", :repo => "boxen/puppet-vlc" | |
github "handbrake", "1.0.0", :repo => "boxen/puppet-handbrake" | |
github "virtualbox", "1.0.3", :repo => "mrben/puppet-virtualbox" |
# encoding: utf-8 | |
from django import http | |
from django.conf import settings | |
try: | |
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS | |
except AttributeError: | |
XS_SHARING_ALLOWED_ORIGINS = '*' | |
try: |
from django.db import models | |
class Thing(models.Model): | |
# [ snip ] | |
def is_deletable(self): | |
for rel in self._meta.get_all_related_objects(): | |
if rel.model.objects.filter(**{rel.field.name: self}).exists(): | |
return False | |
return True |
I hereby claim:
To claim this, I am signing this object: