Skip to content

Instantly share code, notes, and snippets.

@borgar
borgar / keybase
Created October 1, 2014 18:58
Keybase ID
### Keybase proof
I hereby claim:
* I am borgar on github.
* I am borgar (https://keybase.io/borgar) on keybase.
* I have a public key whose fingerprint is 1964 9E49 702A CC81 3B14 14F0 5A96 CA4A A3F8 E964
To claim this, I am signing this object:
@borgar
borgar / pngfix.sh
Created May 18, 2010 11:53
A bash script to run PNGs through both pngcrush and opticrush using unreasonably zealous settings.
#!/bin/bash
# This script attacks either all file arguments given to it, or all png's in a subtree (if
# a directory or no argument is given), and runs both pngcrush and optipng on them with liberal settings.
CRUSH=$(which pngcrush)
OPTI=$(which optipng)
OPTS1='-rem cHRM -rem gAMA -rem iCCP -rem sRGB -q'
OPTS2='-quiet -fix -o4'
TEMP="/tmp/temp.png"
BEFORE=0
@borgar
borgar / each.js
Created November 15, 2010 22:18
A yielding each function for large collections.
/*
* A variation on a jQuery style each function for massive or labour intensive
* loops where the thread is yielded every so often to prevent script timeouts.
*
* (c) Borgar Thorsteinsson
* Licenced under the terms of the MIT/GPL software licenses.
*
* The function accepts these arguments:
*
* `obj`: an array, object, or string to be looped though.
@borgar
borgar / pre-commit
Created September 19, 2011 19:48
Git pre-commit hook to prevent JS trailing commas being checked in to projects.
#!/usr/bin/env python
"""
Git pre-commit hook to prevent JS trailing commas being checked in.
They have a tendency to sneak into the project and they crash MSIE7.
"""
import sys
import re
import subprocess
@borgar
borgar / .block
Last active March 8, 2016 22:03
Broad Street Pump
license: mit
height: 800
@borgar
borgar / .block
Last active March 9, 2016 12:53
Marey's Train Timetable
license: mit
height: 500
border: no
@borgar
borgar / .block
Last active March 13, 2016 21:59
Slopegraph
license: gpl-3.0
height: 940
border: no
@borgar
borgar / .block
Last active March 18, 2016 13:31
Tooth Eruption
license: gpl-3.0
height: 500
border: no
@borgar
borgar / .block
Last active September 4, 2016 19:37
U.S. murder rate grid map
license: mit
height: 550
@borgar
borgar / .block
Created October 6, 2016 00:31
Wind Particles
license: MIT
height: 600