Skip to content

Instantly share code, notes, and snippets.

@qerub
qerub / mate-line.rb
Created May 8, 2011 23:30
Wrapper for TextMate's mate command that makes it easy to open a particular line
#!/usr/bin/env ruby
ARGV.each do |arg|
name, line = arg.split(":")
system("mate", name, "--line", line)
end
@qerub
qerub / svn-diff-color.sh
Created May 8, 2011 23:27
Wrapper for svn diff that sets --diff-cmd=colordiff
#!/bin/sh
# http://colordiff.sourceforge.net/
if tty -s; then
exec svn diff --diff-cmd=colordiff "$@" | less -R
else
exec svn diff --diff-cmd=colordiff "$@"
fi
@qerub
qerub / xmlindent.rb
Created April 5, 2011 22:56 — forked from EmmanuelOga/xmlindent.rb
XML prettyprinter (implemented with XSLT)
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
XSL = <<-EOXSL
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1"/>
<xsl:param name="indent-increment" select="' '"/>
@qerub
qerub / textile+lhs2html.rb
Created November 29, 2009 22:05
textile+lhs2html
#!/usr/bin/env ruby
#
# textile+lhs2html
#
# A script for transforming Literate Haskell
# with Textile-formatted text to HTML with
# the help of Ruby and RedCloth.
#
# Written by Christoffer Sawicki in 2009.
# Released into the public domain.