Skip to content

Instantly share code, notes, and snippets.

View trevmex's full-sized avatar
👨‍👩‍👧‍👦

Trevor Menagh trevmex

👨‍👩‍👧‍👦
View GitHub Profile
View user.watch.js
/*
* user.watch v1.0: Cross-browser user.watch
* From http://code.eligrey.com/object.watch/
*
* By Elijah Grey, http://eligrey.com
* Tweaked by Trevor Lalish-Menagh, http://trevmex.com
*
* A shim that partially implements object.watch and object.unwatch
* in browsers that have accessor support.
*
View refactoring patterns.rb
# Extract Method (http://refactoring.com/catalog/extractMethod.html)
#
# not refactored
#
def self.display_name(login)
ad_entry = self.find(login)
first_name_match = /FirstName:\s*(.*)$/.match(self.find(login))
last_name_match = /LastName:\s*(.*)$/.match(self.find(login))
@trevmex
trevmex / install_homebrew.rb
Created May 24, 2010 13:02 — forked from mxcl/install_homebrew.markdown
Install in any directory via command line arguments. The default behavior is still intact.
View install_homebrew.rb
#!/usr/bin/ruby
#
# Download and execute this script in one-line with no temporary files:
#
# ruby -e "$(curl http://gist.github.com/raw/411826/install_homebrew.rb)"
#
#
# 24th May 2010 (trevmex):
# Adapted mxcl's fork: http://gist.github.com/323731
# Changed mxcl's code to include a prefix command line variable to allow