This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Asteroid City is a huge city floating in space on top of an asteroid. It has a huge glass dome all | |
around it so everyone can breathe, and the city is home of all kinds of aliens. There are shops and | |
businesses and houses all throughout the city. | |
In the center of Asteroid City is a huge park, Starview Park, where the people of Asteroid City love | |
to go for picnics, splash in the water pools, and climb trees. | |
At the north end of Starview Park lies a huge hill, and at the top of the hill is Starview Castle, | |
the home of Jack and Batabamh. Jack and Batabamh are twin brothers, and they are princes! They live in | |
the castle with their parents, King Botar and Queen Sheila, and their baby sister Ella. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ferguson: | |
Who Taught You To Live Like That? | |
Green Gardens, Cold Montreal | |
Pretty Voice | |
The Lines You Amend | |
Pentland: | |
The Good In Everyone | |
HFXNSHC | |
Money City Maniacs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_all_submodules(): | |
checks = [] | |
for module in os.listdir(pkg_resources.resource_filename(__name__, '../this_package/submodules')): | |
if module == '__init__.py' or module[-3:] != '.py': | |
continue | |
checks.append(importlib.import_module('this_package.submodules.{}'.format(module[:-3]))) | |
return checks | |
def all_subclasses(myclass): | |
def get(c): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Like git-rebase -i, but without touching the index or working tree. | |
function git-squash() { | |
if [ "$1" == "" ]; then | |
echo "usage: git-squash <number_of_commits_to_squash>" | |
return | |
fi | |
# note the current HEAD commit | |
old_head=$(git rev-parse HEAD) | |
echo "Current HEAD: $old_head" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -u | |
""" | |
A Minimalist webserver that listens on 8000, handles gets, and renders markdown if the request asks for a file ending in .md. | |
""" | |
import os | |
import SimpleHTTPServer | |
import mistune | |
renderer = mistune.Renderer(hard_wrap=True) | |
markdown = mistune.Markdown(renderer=renderer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example 1: | |
# laptop% ssh remotehost | |
# remotehost% uptime | laptop remote_uptime | |
# remotehost% exit | |
# laptop% cat remote_uptime | |
# 20:41:11 up 9 days, 4:02, 20 users, load average: 0.02, 0.01, 0.00 | |
# | |
# In other words, it's like starting this: | |
# laptop% ssh remotehost uptime > remote_uptime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Several years ago I worked for a company that had a lot of very senior engineers, many of whom had worked quite closely for many years. When the company started hiring new talent, many of whom were younger, frictions arose. One such problem was the ongoing, entrenched issue of tab widths. The senior engineers, true to their idiosyncratic nature, preferred three spaces for tabs. The newer engineers generally preferred four, and being young, often held an attitude of superiority and a certain contempt for their elders. They continually committed changes with tabs four spaces wide, which the senior engineers would revert. Tensions flared, increasingly antagonistic commit messages were logged, and flamewars erupted between proponents of three-wide tabs ("the threes") and those of four-wide tabs ("the 4ists"). | |
This went on for some time, until at last an exasperated engineering manager called an all-hands meeting, and got everyone in a room. He said that they would put it to a vote, and sure enough, when he asked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# Drink better coffee. | |
# | |
# Commands: | |
# hubot make me some coffee - Serve up a cup of joe | |
# hubot get coffee <name> from <roaster> @ <url> - add a coffee to the bar | |
# hubot sell me that coffee - provide source URL for the last coffee served | |
# | |
sizes = ['6oz','8oz','12oz','16oz','24oz'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ITER=10 | |
SCALE=3 | |
CMD=$* | |
bc <<< "scale=$SCALE; $(for i in `seq 1 $ITER`; do $CMD &>/dev/null && echo $?; sleep 1; done | wc -l)/$ITER * 100" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core import serializers | |
from django.core.management.commands.loaddata import Command as LoadDataCommand | |
import os | |
def read_fixture(file_name): | |
""" | |
Read a fixture and return a list of objects without updating the database. | |
This method is derived from django.core.management.commands.Command.load_label(), |