This file contains hidden or 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/env ruby | |
| require 'rubygems' | |
| require 'rbosa' | |
| account='xxx' | |
| username='xxx' | |
| password='xxx' | |
| api="https://#{account}.presentlyapp.com/api/twitter/statuses/update.xml" | |
| itunes = OSA.app("iTunes") |
This file contains hidden or 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
| class User < ActiveRecord::Base | |
| validates_presence_of :email, :password, :password_confirmation | |
| acts_as_authentic | |
| end |
This file contains hidden or 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
| === Epic Snow Leopard Upgrayyyyd Guide === | |
| Son, you’re now living in the land of 64-bit systems. | |
| That means that some of your 32-bit shit is now broken. | |
| Not all is lost. | |
| == Fixing MySQL weirdness |
This file contains hidden or 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
| # Eric Wallace and Adam Bair | |
| # Ruby Games (github.com/clr/ruby_games) #003 | |
| class WideFinder | |
| def initialize( findee ) | |
| @counts = Hash.new(0) | |
| if findee.kind_of?(Array) | |
| countme( findee ) | |
| elsif findee.kind_of?(String) |
This file contains hidden or 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/env ruby | |
| `/usr/bin/open http://cheat.errtheblog.com/s/#{ARGV[0]}` |
This file contains hidden or 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
| → git commit | |
| % Total % Received % Xferd Average Speed Time Time Time Current | |
| Dload Upload Total Spent Left Speed | |
| 102 2556 104 626 101 1930 317 979 0:00:01 0:00:01 --:--:-- 1171 | |
| [master 44244cf] Fix #35 Contractor tabs | |
| 22 files changed, 609 insertions(+), 145 deletions(-) | |
| create mode 100644 app/views/contractors/_contract.html.erb | |
| rewrite app/views/contractors/show.html.erb (90%) | |
| create mode 100755 public/images/ui-bg_flat_0_aaaaaa_40x100.png | |
| create mode 100755 public/images/ui-bg_flat_75_ffffff_40x100.png |
This file contains hidden or 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
| * Beautiful code is the balanced application of Proportion, Integrity, and Clarity. | |
| Proportion | |
| /\ [ each are necessary ] | |
| / \ [ none are sufficient ] | |
| /____\ | |
| Integrity Clarity | |
| * Proportion: The smallest size needed to do the job. |
This file contains hidden or 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
| # How to setup multiple heroku accounts | |
| # (assuming you already have one setup) | |
| # make sure ~/bin is in your path | |
| create ~/bin/hcred and populate it with the following: | |
| 1 #!/usr/bin/env ruby | |
| 2 | |
| 3 `rm ~/.heroku/credentials` |
This file contains hidden or 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
| def self.defaults | |
| defaults = OpenStruct.new | |
| defaults.from_date = default_from_date | |
| defaults.to_date = default_to_date | |
| defaults | |
| end | |
| def self.default_from_date | |
| default_date - 1.year | |
| end |
This file contains hidden or 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
| class ProductObserver < ActiveRecord::Observer | |
| observe :product | |
| def after_save(product) | |
| reload_routes | |
| end | |
| def after_destroy(product) | |
| reload_routes | |
| end |