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
/* | |
* 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. | |
* |
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
# 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)) | |
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/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 |