Skip to content

Instantly share code, notes, and snippets.

@snydergd
snydergd / vizhash.py
Created January 10, 2016 05:05
python VizHash using PIL
#!/bin/env python2
"""
Visual hash (see [html5 implementation](https://github.com/sametmax/VizHash.js) and
[original creator's website](http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd))
reimplemented using a Python script with PIL.
"""
from PIL import Image,ImageDraw
import hashlib
import sys
@snydergd
snydergd / pb
Last active January 6, 2016 02:35
Bash completion for packagebuilder pb command
# bash completion for packagebuilder pb command
# (wrapper for pacman and aur on Arch Linux)
_pb() {
local word;
word=${COMP_WORDS[$COMP_CWORD]};
COMPREPLY=( $(pb -Ss "^${word}" 2>/dev/null | grep '^\S' | sed -e 's/^.*\/\(\S\+\)\s.*/\1/') );
return 0;