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 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 | |
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
/* | |
* 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. |
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
/* | |
* Tiny tokenizer | |
* | |
* - Accepts a subject string and an object of regular expressions for parsing | |
* - Returns an array of token objects | |
* | |
* tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid'); | |
* result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ] | |
* | |
*/ |
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 | |
# 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 |
NewerOlder