This file contains hidden or 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 | |
# A script for launching OS X apps using any given human language. | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 [language] [application]" | |
echo "Example:" | |
echo " $0 fr_CA /Applications/iCal.app" | |
exit 1 | |
fi |
This file contains hidden or 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 | |
# This is the code used to select the winner of | |
# the Tauntaun Sleeping Bag Contest, sponsored by | |
# Bleeding Wolf Productions. | |
# | |
# The code has been made public so it's fairness | |
# can be challenged if necessary. The contestants' | |
# data have been removed to protect their privacy. | |
# |
This file contains hidden or 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 deployment.cuisine import * | |
from fabric.api import * | |
from fabric.context_managers import * | |
from fabric.utils import puts | |
from fabric.colors import red, green | |
import simplejson | |
import os |
This file contains hidden or 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
$ curl -v http://simpledesktops.com/api/desktop/random/ | |
* About to connect() to simpledesktops.com port 80 (#0) | |
* Trying 205.186.149.79... connected | |
* Connected to simpledesktops.com (205.186.149.79) port 80 (#0) | |
> GET /api/desktop/random/ HTTP/1.1 | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
> Host: simpledesktops.com | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK |
This file contains hidden or 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 fabric.api import settings, roles, env, run, sudo, cd | |
from fabric.decorators import task | |
from fabric import tasks | |
from fabric.contrib.project import rsync_project | |
env.roledefs = { | |
'dev': [ | |
'[email protected]:2222' |
This file contains hidden or 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
class Greeter: | |
def __init__(self, greeting=None): | |
self.myGreeting = greeting or 'Hello World!' | |
def greeting(self): | |
return self.myGreeting |
This file contains hidden or 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 pyramid(level): | |
if level == 1: | |
return 1 | |
return (level * level) + pyramid(level-1) | |
assert pyramid(1) == 1 | |
assert pyramid(2) == 5 | |
assert pyramid(3) == 14 |
This file contains hidden or 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 pyramid(level): | |
total = 0 | |
for x in range(1, level+1): | |
total += (x * x) | |
return total | |
assert pyramid(1) == 1 | |
assert pyramid(2) == 5 | |
assert pyramid(3) == 14 |
This file contains hidden or 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 | |
import sys | |
import subprocess | |
def runserver_bonjour(service_name, service_type, port): | |
django_process = subprocess.Popen( | |
['python', 'manage.py', 'runserver', '0.0.0.0:%s' % port], |
OlderNewer