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
| ### parse_modified_files_from_git.rb | |
| #!/usr/bin/env ruby -wn | |
| modified_file_pattern = /^#\s+(?:modified|new file):\s+(.*)$/ | |
| puts $1 if modified_file_pattern =~ $_ | |
| ### rm_trailing_whitespace.rb | |
| #!/usr/bin/env ruby -wn |
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 TaskListPanelSweeper < ActionController::Caching::Sweeper | |
| observe Task, TaskList, Comment | |
| def after_save(record) | |
| if expire_cache?(record) | |
| expire_task_list_panel(record) | |
| end | |
| end | |
| private |
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 | |
| # | |
| # Update iChat/Adium/Skype status | |
| # | |
| # USAGE: imstatus <online|available|offline|away|dnd|invisible> [message] | |
| # (supports partial status identifiers like 'on' or 'aw') | |
| # | |
| # László Bácsi <[email protected]> | |
| # http://github.com/lackac |
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
| # put this in your ~/.bash_login and then call it like "open_bundler_gem paperclip" | |
| # opens the designated gem in the bundler directory of your Rails app | |
| open_bundler_gem () { | |
| matched_dirs=`find vendor/bundler_gems -name "*$1*" -type d`; | |
| matched_dirs=`echo $matched_dirs`; | |
| gem_dir_pos=`expr "$matched_dirs" : '[^ ]*'`; | |
| mate ${matched_dirs:0:$gem_dir_pos}; | |
| } |
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
| require "user_creation_service" | |
| require "spec" | |
| require "rr" | |
| Spec::Runner.configure do |config| | |
| config.mock_with RR::Adapters::Rspec | |
| end | |
| describe UserCreationService do | |
| before do |
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 HomeApp | |
| def call(env) | |
| [200, {"Content-Type" => "text/plain"}, ["Hello World!"]] | |
| end | |
| end | |
| Marketinsushi::Application.routes.draw do |map| | |
| # match "/home" => HomeApp | |
| mount HelloWorld.new => "/home" | |
| match '/' => "static#welcome" |
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
| <!-- taken from http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population --> | |
| <tr> | |
| <td align="center">1</td> | |
| <td><a href="/wiki/New_York_City" title="New York City">New York City</a></td> | |
| <td><a href="/wiki/New_York" title="New York">New York</a></td> | |
| <td align="right"><span style="display:none">&0000000008391881.000000</span>8,391,881</td> | |
| </tr> | |
| <tr> | |
| <td align="center">2</td> | |
| <td><a href="/wiki/Los_Angeles" title="Los Angeles">Los Angeles</a></td> |
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
| describe "Man" do | |
| let(:the_sunshine_in) { } | |
| subject { anybody } | |
| it { should be_happy } | |
| 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
| CODE = [112,117,116,115,32,34,67,79,68,69,32,61,32,35,123,67,79,68,69,46,105,110,115,112,101,99,27,99,116,125,34, 10,67,79,68,69,46,101,97,99,104,32,123,124,99,124,32,112,114,105,110,116,32,99,46,99,104,114,32,125,10] | |
| puts "CODE = #{CODE.inspect}" | |
| CODE.each { |c| print c.chr } |