- Software Update
- Alfred (app store)
- 1Password (app store)
| # Basic Settings | |
| # | |
| fontName = "Monaco" | |
| fontSize = 12 | |
| # Extra files to include | |
| # | |
| myExtraIncludes = ".tm_properties,.htaccess,.gitignore" | |
| fileBrowserGlob = "{*,$myExtraIncludes}" | |
| include = "{$include,$myExtraIncludes}" | 
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'RMagick' | |
| require 'capybara' | |
| require 'capybara/dsl' | |
| # ================================================================ | |
| # Collect input args | |
| # ================================================================ | |
| begin | 
| BIG_NUMBER = 600_851_475_143 | |
| require 'prime' | |
| def slow_largest_prime_factor_of(n) | |
| possible_prime_factors = primes_up_to(Math.sqrt(n).to_i) | |
| returner = nil | |
| possible_prime_factors.each do |f| | |
| if n % f == 0 | |
| returner = f | 
| module JQueryEventsHelpers | |
| def trigger_js_event(selector, event) | |
| script = "$('#{selector}').trigger('#{event}')" | |
| page.execute_script(script); | |
| end | |
| end | |
| World(JQueryEventsHelpers) | 
| #!/usr/bin/env ruby | |
| # Outputs sorted args to stdout | |
| # from: | |
| # http://dis.4chan.org/read/prog/1295544154/170 | |
| def sleep_sort(*args) | |
| args.each { |e| fork { sleep(e.to_f/1000); puts e } } | |
| end | |
| sleep_sort(*ARGV) | 
| 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" => { | 
| # with AWK | |
| curl -s http://www.gutenberg.org/files/1080/1080.txt | | |
| awk ' | |
| BEGIN { FS="[^a-zA-Z]+" } | |
| { | |
| for (i=1; i<=NF; i++) { | |
| word = tolower($i) | |
| words[word]++ | |
| } | 
| # CLOSURES IN RUBY Paul Cantrell http://innig.net | |
| # Email: username "cantrell", domain name "pobox.com" | |
| # I recommend executing this file, then reading it alongside its output. | |
| # | |
| # Alteratively, you can give yourself a sort of Ruby test by deleting all the comments, | |
| # then trying to guess the output of the code! | |
| # A closure is a block of code which meets three criteria: | 
| require 'acceptance/acceptance_helper' | |
| feature "Articles", %q{ | |
| In order to have an awesome blog | |
| As an author | |
| I want to create and manage articles | |
| } do | |
| background do | |
| Article.create!(:title => 'One') |