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
# 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
* { | |
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
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
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 |
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
package main | |
import ( | |
"net" | |
"os" | |
"log" | |
"fmt" | |
"io" | |
) |
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
# Prerequisites | |
# | |
# - npm install -g hcron | |
import subprocess | |
cron_input = open('cron.input.txt') | |
cron_output = open('cron.output.txt', 'w') | |
for line in cron_input.readlines(): |
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
# https://docs.djangoproject.com/en/2.0/topics/http/urls/#including-other-urlconfs | |
from django.urls import include, path | |
from . import views | |
# Change this | |
urlpatterns = [ | |
path('<page_slug>-<page_id>/history/', views.history), | |
path('<page_slug>-<page_id>/edit/', views.edit), |
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
pico-8 cartridge // http://www.pico-8.com | |
version 16 | |
__lua__ | |
line_weight = 1 | |
border_colour = 7 | |
up = 2 | |
right = 1 | |
down = 3 | |
left = 0 |
OlderNewer