Skip to content

Instantly share code, notes, and snippets.

Breeds1::Application.routes.draw do
resources :breeds
get 'breeders/:location/', to: "locations#index", as: :breeder_location
get 'breeders/:location/:city/', to: "locations#show", as: :breeder_city
class Array
def my_select
new_array = []
self.each do |el|
new_array << el if yield(el)
end
new_array
end
end
#import "AppDelegate.h"
#import <CheckMate/CheckMate.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[CheckMate initializeFramework:@"af498d68fa9186212a08dfdbd51cd760"];
return YES;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
if ([webView canGoBack]){
NSLog(@"Can Go back");
self.backButton.enabled = YES;
} else {
self.backButton.enabled = NO;
}
if ([webView canGoForward]) {
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard :rspec, all_on_start: false, all_on_pass: false, cmd: 'spring rspec -f doc' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard :rspec, all_on_start: false, all_on_pass: false, cmd: 'spring rspec -f doc' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
function setupTabsFor(tableName, initialTabLocation) {
$('#' + tableName + '-tabs a').click(function (e) {
e.preventDefault()
window.location.hash = this.href.split('#', 2)[1];
$(this).tab('show')
})
var location = window.location.hash;
if(!location) location = '#' + initialTabLocation
$('#' + tableName + '-tabs a[href="' + location + '"]').tab('show')
config.before(:each) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each, :js => true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({