This file contains hidden or 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
module MiniTestWithHooks | |
class Unit < MiniTest::Unit | |
attr_reader :before_suites, :after_suites | |
def before_suites(&block) | |
(@before_suites ||= []) << block | |
end | |
def after_suites(&block) |
This file contains hidden or 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
package main | |
import ( | |
"github.com/hawx/hadfield" | |
"fmt" | |
"os" | |
) | |
var cmdGreet = &hadfield.Command{ | |
Usage: "greet [options]", |
This file contains hidden or 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 sh | |
function usage { | |
echo "lomo [options]" | |
} | |
function short { | |
echo "applies a simple lomo effect to the image." | |
} |
This file contains hidden or 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
package main | |
import ( | |
"code.google.com/p/graphics-go/graphics" | |
"github.com/nfnt/resize" | |
"github.com/hawx/img/blend" | |
"github.com/hawx/img/contrast" | |
"github.com/hawx/img/hsla" | |
"github.com/hawx/img/utils" |
This file contains hidden or 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 sh | |
# Needs to be on $PATH as "img-testing". | |
function usage { | |
echo "testing [args]" | |
} | |
function short { | |
echo "A script to test external img scripts." | |
} |
This file contains hidden or 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
# Usage: sh splitconv.sh "some.pdf" | |
echo "Making temporary directory..." | |
mkdir "splitconv-tmp" | |
echo "Splitting pdf..." | |
convert -size 1x2@ "$1" "splitconv-tmp/split.png" | |
echo "Rotating pages..." | |
convert -rotate 270 "tmp-tmp-tmp/split-*.png" "splitconv-tmp/rot.png" |
This file contains hidden or 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
/* | |
@theme Monokai | |
@override-placeholders html, xml, css, sourcecode.js, sourcecode.php, sass, markdown | |
@author Derek Reynolds | |
@version 1.0b1 | |
@original https://github.com/derekr/monokai.foam | |
This is a port of the Monokai theme for TextMate. | |
The original theme can be found at: http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/ | |
TextMate can be found at: http://macromates.com/ |
This file contains hidden or 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 sh | |
# | |
# Usage: prettymaker <start-row> <end-row> <start-col> <end-col> | |
# | |
# Prettymaker will pull map tiles from in the ranges specified at level 10 | |
# zoom from prettymaps.stamen.com and build a massive map. Each tile is | |
# 256x256px so fully created map may be large! | |
# | |
# Note: run this in an empty folder, it deletes stuff during processing and | |
# may catch items you didn't want deleted. |
This file contains hidden or 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
# Ruby _is_ meta-programming. Well maybe not, but I read somewhere that you | |
# should always start with a strong statement, even if not exactly true, then | |
# clarify it later. | |
# | |
# Anyway, meta-programming is amazing. Let's start with some stupid recursive | |
# definition thing... | |
class SelfDefining | |
def define(&block) | |
self.class.send(:define_method, :define, &block) |
This file contains hidden or 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 ruby | |
# | |
# Usage: tab-format <max-width> <input-file> | |
# eg. tab-format 120 tango.txt > out.txt | |
# | |
# Reformats ascii tabs to different widths. Will complain if tab contains any | |
# other text. So <file> will look like (obviously with numbers in): | |
# | |
# E |---------- ... | |
# B |---------- ... |