Skip to content

Instantly share code, notes, and snippets.

View ggilder's full-sized avatar

Gabriel Gilder ggilder

View GitHub Profile
@mislav
mislav / html.rb
Created May 12, 2010 08:31
Pretty up HTML with Nokogiri and XSLT
require 'nokogiri'
ugly = Nokogiri::HTML ARGF
tidy = Nokogiri::XSLT File.open('tidy.xsl')
nice = tidy.transform(ugly).to_html
puts nice
@subtleGradient
subtleGradient / appify
Created November 11, 2010 16:03
appify. Create the simplest possible mac app from a shell script
#!/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]>
@pzol
pzol / install_ruby192_freebsd.sh
Created December 18, 2010 23:24
How to install rvm 1.9.2 under FreeBSD - this is work in progress and not complete. You have to su or sudo -i to run this
# 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
@cyberfox
cyberfox / TableDelegate.rb
Created February 27, 2011 09:22
An NSTableView delegate with a yellow flash effect
# 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
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
@seanlilmateus
seanlilmateus / gist:1536136
Created December 29, 2011 20:51
macruby core animation Fireworks, have a nice macruby new year
#!/usr/local/bin/macruby
framework 'Cocoa'
framework 'QuartzCore'
framework 'CoreGraphics' # Mountain Lion Update
class FireworkDelegate
attr_accessor :window
def initWithURL(url)
case url