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/python -u | |
import json | |
import sys | |
from pygments import highlight | |
from pygments.lexers import JsonLexer | |
from pygments.formatters import Terminal256Formatter | |
for line in sys.stdin: | |
if line.strip(): |
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
import math | |
import random | |
def getSuccessors(color): | |
def perm(l, n, str_a, perm_a): | |
"""Generate every permutation of length `n`, selecting from the | |
possible values in `l`. | |
""" | |
if len(str_a) == n: | |
return (str_a,) + perm_a |
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 | |
# | |
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box | |
# http://wildfish.com | |
# add the ubuntu gis ppa | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update |
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 | |
# mpo2gif | |
# convert all .mpo files in a directory to a animation gif. | |
# Source: https://gist.github.com/878450 | |
# this idea is from http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=16275 | |
# this script requires exiftool and imagemagick. | |
for file in *.[Mm][Pp][Oo0]; do |