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 'rubygems' | |
require 'mechanize' | |
MAX_PAGES = 6 | |
def each_google_result_page(query, max_pages=MAX_PAGES) | |
i = 0 | |
a = Mechanize.new do |a| | |
a.get('http://google.com/') do |page| | |
search_result = page.form_with(:name => 'f') do |search| |
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 'rubygems' | |
require 'yaml' | |
# A demonstration of YAML anchors, references and handling of nested values | |
# For more info, see: | |
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ | |
stooges = YAML::load( File.read('stooges.yml') ) | |
# => { | |
# "default" => { |
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
# You can find the volume UUID in Disk Utility. Select the volume on the left | |
# and then File->Get Info. See "Universal Unique Identifier". | |
# | |
# Options used below: | |
# ro for readonly (can be omitted) | |
# noauto to prevent auto-mount | |
# noatime to skip writing last access times (performance thing, optional) | |
# | |
# Remember to set the filesystem type (hfs, ntfs, etc) too | |
########## |
NewerOlder