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
require 'nokogiri' | |
ugly = Nokogiri::HTML ARGF | |
tidy = Nokogiri::XSLT File.open('tidy.xsl') | |
nice = tidy.transform(ugly).to_html | |
puts nice |
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 bash | |
# | |
# url : https://gist.github.com/672684 | |
# version : 2.0.2 | |
# name : appify | |
# description : Create the simplest possible mac app from a shell script. | |
# usage : cat my-script.sh | appify MyApp | |
# platform : Mac OS X | |
# author : Thomas Aylott <[email protected]> |
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
# this does not run as a complete script :( | |
pkg_add -r bash curl sudo | |
pkg_add -r git vim # can you live without it? | |
pkg_add -r libxml2 libxslt # for nokogiri later | |
pw usermod pzol -G wheel | |
bash # start bash and run the rest inside it | |
curl -# -L http://bit.ly/rvm-install-system-wide > rvm-install-system-wide | |
bash -l < rvm-install-system-wide |
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
# TableDelegate.rb | |
# | |
# An example of capturing double-clicks and a yellow-fade technique in MacRuby. | |
# The yellow fade technique implementation is a ruby-ized translation | |
# of http://www.bdunagan.com/2009/04/26/core-animation-on-the-mac/ | |
# Created by Morgan Schweers on February 26, 2011. | |
framework 'Cocoa' | |
class TableDelegate |
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
pry(main)> blame Pry#repl | |
John Mair def repl(target=TOPLEVEL_BINDING) | |
John Mair target = Pry.binding_for(target) | |
John Mair target_self = target.eval('self') | |
John Mair | |
John Mair repl_prologue(target) | |
Mon ouïe | |
John Mair # cannot rely on nesting.level as | |
John Mair # nesting.level changes with new sessions | |
John Mair nesting_level = nesting.size |
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/local/bin/macruby | |
framework 'Cocoa' | |
framework 'QuartzCore' | |
framework 'CoreGraphics' # Mountain Lion Update | |
class FireworkDelegate | |
attr_accessor :window | |
def initWithURL(url) | |
case url |