Skip to content

Instantly share code, notes, and snippets.

View zacbir's full-sized avatar
📐
Studying Delaunay Triangulation

Zachery Bir zacbir

📐
Studying Delaunay Triangulation
View GitHub Profile
@zacbir
zacbir / .bashrc-dvcs
Created August 10, 2012 13:51
.bashrc-dvcs
# Adapted from http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir [bzr:master]$ # clean working directory
# username@Machine ~/dev/dir [bzr:master*]$ # dirty working directory
# git
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
@zacbir
zacbir / fish_prompt.fish
Created August 10, 2012 17:07
fish_prompt.fish
# Add to ~/.config/fish/functions/fish_prompt.fish
function parse_git_dirty
set -x git_output (git status 2> /dev/null | tail -n1)
if test $git_output
test $git_output = "nothing to commit (working directory clean)"; or echo -n "*"
end
end
function parse_git_branch

Keybase proof

I hereby claim:

  • I am urbanape on github.
  • I am urbanape (https://keybase.io/urbanape) on keybase.
  • I have a public key whose fingerprint is DD63 1A65 342D 6575 F6EC 72FA 752C 9BE2 C0D8 203C

To claim this, I am signing this object:

@zacbir
zacbir / fish_prompt.fish
Created July 2, 2014 15:47
Fish prompt
function parse_git_dirty
set -x git_output (git status 2> /dev/null | tail -n1)
if test $git_output
if test $git_output = "nothing to commit, working directory clean"
echo -n green
return
else
echo -n yellow
return
end

Keybase proof

I hereby claim:

  • I am zacbir on github.
  • I am zacbir (https://keybase.io/zacbir) on keybase.
  • I have a public key whose fingerprint is 07C7 251D C4EB 7864 005A B751 D6AA C720 D86E D4F4

To claim this, I am signing this object:

@zacbir
zacbir / punk.py
Created April 12, 2017 21:01 — forked from wting/punk.py
Don't be a punk, punk
import binascii
import struct
class Punk(object):
"""Full blog post about hiding data within PNG files here:
http://blog.brian.jp/python/png/2016/07/07/file-fun-with-pyhon.html
Example use case:

Blubber

Blubber is a tool for creating a Docker container description file from a manifest configuration file describing one or more variants and an optional policy validation ruleset.

Usage

$ blubber blubber.example.yaml development [file:///path/to/policy-file.yaml] > Dockerfile
"""
When a local brewery, Strangeways, posted this on their Instagram
(https://www.instagram.com/p/B-K53XWH77G/?igshid=14k3jx3o5bpfe),
I thought it was cool, but would be limiting. What it needed was a
way to shuffle up the exercises day-to-day.
"""
import random
import string