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
id title address created_on lat lng notes | |
1 Academy Canada 167-169 Kenmount Road 2005-12-25 07:27:07 47.555099 -52.766663 Unsecure connection from nearby house | |
2 Airport Airport Heights 2005-12-25 07:28:26 47.6202811 -52.751712 NULL | |
3 Chad's House 13 Liverpool Ave 2005-12-25 07:28:45 47.565027 -52.726991 NULL | |
4 Coffee & Company 204 Water Street 2005-12-25 07:29:08 47.563719 -52.707639 NULL | |
5 Convergys Customer Management 274 Torbay Road 2005-12-25 07:29:37 47.599109 -52.711220 Unsecure (admin:admin) from a nearby house | |
6 Credit Union 341 Freshwater Road 2005-12-25 07:30:39 47.561087 -52.746051 NULL | |
7 Don Cherry's 290 Freshwater Road 2005-12-25 07:31:28 47.563165 -52.741338 NULL | |
8 Future Shop 20 Stavanger Dr 2005-12-25 07:31:45 47.615481 -52.718738 NULL | |
9 Hava Java 216 Water Street 2005-12-25 07:32:13 47.564143 -52.707250 NULL |
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
#!/bin/sh | |
calculate () | |
{ | |
local value=$(echo "$*" | bc -q) | |
echo $value | |
} | |
float_conditional () | |
{ |
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
# ... | |
workon () { | |
OLDIFS=$IFS | |
IFS=$'\n' | |
output=$(workon.rb $1) | |
for line in $output; do | |
echo $line |
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
#!/bin/sh | |
osascript - <<EOF | |
tell application "System Events" | |
key code $1 | |
end tell | |
EOF |
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
Given | |
class Post < ActiveRecord::Base | |
def to_s; title; end | |
end | |
Then | |
notice :create => :post | |
# flash[:notice] = I18n.t :"post.create.notice", :scope => [ :flashes ], :post => @post.to_s |
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 ActionController::TestCase | |
# setup :mock_warden | |
teardown :cleanup_warden_env | |
def warden | |
@_warden ||= mock | |
end | |
def mock_warden_for(*scopes) | |
scopes.each do |scope| |
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
# shoulda validation that a partial has been rendered by a view | |
class Test::Unit::TestCase | |
def self.should_render_partial(partial) | |
should "render partial #{partial.inspect}" do | |
# add the underscore. it's expected anyways | |
assert_template :partial => partial.to_s.sub(/\/(\w+)$/, '/_\1') | |
end | |
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 BooksController < ApplicationController | |
def index | |
@books = resources | |
end | |
private | |
def resources | |
administrator? ? Book.all : Book.published | |
end | |
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 RegistrationsController < ApplicationController | |
STEP_VALIDATIONS = [ | |
%w(first_name last_name), | |
%w(billing_address) | |
] | |
def new | |
@user = User.new | |
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
Example: | |
<%= link_to_named_routes :hello, [ :world, :foo, :bar ], :base_class => 'tabs' %> | |
Will give you: | |
<ul class="tabs depth-0"> | |
<li class="active"> | |
<a href="/hello">Hello!</a> | |
</li> |
OlderNewer