Skip to content

Instantly share code, notes, and snippets.

Avatar
😶
Staring at this box to think of something funny

Alex Ezell aezell

😶
Staring at this box to think of something funny
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am aezell on github.
  • I am aezell (https://keybase.io/aezell) on keybase.
  • I have a public key ASCWA-X8F38nLgtpKm9cGRfgH_Sv6HSr-RCjD4NgGpno5go

To claim this, I am signing this object:

View pig_latin.py
sentence = "I don't really know how to handle the changes that we seem to deliberate about while smiling."
words = sentence.split(" ")
vowels = ["a","e","i","o","u"]
digraphs =["bl", "br", "ch", "ck", "cl", "cr", "dr", "fl", "fr", "gh", "gl", "gr", "ng", "ph", "pl", "pr", "qu", "sc", "sh", "sk", "sl", "sm", "sn", "sp", "st", "sw", "th", "tr", "tw", "wh", "wr"]
trigraphs = ["nth", "sch", "scr", "shr", "spl", "spr", "squ", "str", "thr"]
new = []
for word in words:
View pynash help
# Make sure that the_flying_circus() returns True
def the_flying_circus():
if (5 != 7) and (6 > 4):
print "You have Mastered Silly Walks!"
elif 4 < 7:
print "And now for something completely different."
else:
print "AAAAAAARRRRRRGH"
View keybase.md

Keybase proof

I hereby claim:

  • I am aezell on github.
  • I am aezell (https://keybase.io/aezell) on keybase.
  • I have a public key whose fingerprint is BE6D 46F1 0196 2F85 AD81 3EB7 D837 BA7C B9B3 C3E6

To claim this, I am signing this object:

View pre-push.sh
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
View pre-push
#!/usr/bin/env ruby
# This script has been slightly adapted from:
# http://blog.bigbinary.com/2013/09/19/do-not-allow-force-pusht-to-master.html
class PrePushHandler
def handle
reject if force_pushing? && pushing_to_master?
end
View fight_of_the_wolves.txt
An elder was teaching his grandchildren about life. He said to them,
"A fight is going on inside me.. it is a terrible fight and it is
between two wolves. One wolf represents fear, anger, envy, sorrow,
regret, greed, arrogance, self-pity, guilt, resentment, inferiority,
lies, false pride, superiority, and ego.
The other stands for joy, peace, love, hope, sharing, serenity,
humility, kindness, benevolence, friendship, empathy, generosity,
truth, compassion, and faith."
View fabfile.py
# Usage: fab provision:type=cache_server
from fabric.api import task, run
import boto
@task
def provision(type="cache_server"):
# do some boto stuff
if type == "app_server":
# build an app server
@aezell
aezell / empty_object.js
Created Nov 28, 2012
Is Javascript Object Empty?
View empty_object.js
// found here http://stackoverflow.com/a/2673229/64266
function isEmptyObject(obj) {
for(var prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
return false;
}
}
return true;
}
@aezell
aezell / dict_comp.py
Created Nov 14, 2012
Dictionary comprehension
View dict_comp.py
# stolen from http://stackoverflow.com/a/7276556/64266
def countChar(word):
return dict((item, word.count(item)) for item in set(word))
>>> countChar('google')
{'e': 1, 'g': 2, 'o': 2, 'l': 1}
>>> countChar('apple')
{'a': 1, 'p': 2, 'e': 1, 'l': 1}