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
* { | |
margin:0; | |
padding:0; | |
box-sizing:border-box; | |
} | |
html { | |
background:#eee; | |
font-family: Arial; | |
} |
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/sh | |
# Start from the repository root. | |
cd ./$(git rev-parse --show-cdup) | |
# Delete .pyc files and empty directories. | |
find . -name "*.pyc" -delete | |
find . -type d -empty -delete | |
echo "$(tput bold).pyc files and empty directories deleted.$(tput sgr0)" |
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
python -c "from random import sample; print 'EuroMillion numbers: %s %s' % (sample(range(1, 51), 5), sample(range(1, 12), 2))" |
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
# Play sound after command has finished. | |
# | |
# Usage: | |
# end ./manage.py test | |
end() { | |
"$@" && paplay /usr/share/sounds/alsa/Front_Left.wav | |
} |
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
# First su in as root | |
sudo su | |
# Then set fan control to manual mode | |
echo 1 > /sys/devices/platform/applesmc.768/fan1_manual | |
# Then set the fan speed to any value between fan1_min and fan1_max. To view these values | |
cat /sys/devices/platform/applesmc.768/fan1_min | |
cat /sys/devices/platform/applesmc.768/fan1_max |
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
# First su in as root | |
sudo su | |
# Then cd to backlight directory | |
cd /sys/class/leds/smc::kbd_backlight/ | |
# Turn the backlight on | |
cat max_brightness > brightness | |
# Set to zero to turn off the backlight |
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 | |
case $1 in | |
up) | |
TOTAL=`expr $CURRENT + $INCREMENT` | |
if [ $TOTAL -gt $MAX ]; then | |
exit 1 | |
fi | |
echo $TOTAL > $FILE | |
;; |
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
javascript:(function() { | |
var adjectives = [ | |
"Autumn", "Hidden", "Bitter", "Misty", "Silent", "Empty", "Dry", "Dark", "Summer", "Icy", | |
"Delicate", "Quiet", "White", "Cool", "Spring", "Winter", "Patient", "Twilight", "Dawn", | |
"Crimson", "Wispy", "Weathered", "Blue", "Billowing", "Broken", "Cold", "Damp", "Falling", | |
"Frosty", "Green", "Long", "Late", "Lingering", "Bold", "Little", "Morning", "Muddy", "Old", | |
"Red", "Rough", "Still", "Small", "Sparkling", "Wandering", "Withered", "Wild", "Black", | |
"Young", "Holy", "Solitary", "Fragrant", "Aged", "Snowy", "Proud", "Floral", "Restless", | |
"Divine", "Polished", "Ancient", "Purple", "Lively", "Nameless"]; | |
var nouns = [ |
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.servers.basehttp import WSGIRequestHandler | |
# Grab the original log_message method. | |
_log_message = WSGIRequestHandler.log_message | |
def log_message(self, *args): | |
# Don't log if path starts with /static/ | |
if self.path.startswith("/static/"): | |
return | |
else: |
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 bash | |
git branch | while read BRANCH ; do | |
git checkout $BRANCH &> /dev/null; | |
LINE_COUNT=`wc -l $(git ls-files | grep "\(.html\|.py\)$") | tail -n 1` | |
echo "$LINE_COUNT $BRANCH" | |
done | sort -r |
OlderNewer