This file contains 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
You are the manager at HappiTails animal shelter | |
You need to do the following: | |
1. manage the clients coming into the shelter | |
1a (track their names, ages, gender, kids and the number of pets they have) | |
2. manage the animals | |
2a (track their names, breed, age, gender and their favorite toys) | |
3. a client will want to come in and see the list of available animals to adopt | |
4. a client will want to come in a give up their animal for adoption | |
5. want to list the animals in the shelter | |
6. want to list the clients |
This file contains 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
RSpec.configure do |config| | |
config.color_enabled = true | |
config.tty = true | |
config.formatter = :documentation | |
end |
This file contains 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
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
This file contains 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 'pg' | |
require 'pry' | |
conn = PG.connect(:dbname =>'db_name', :host => 'localhost') | |
conn.exec( "select * from table_name" ) do |result| | |
result.each do |row| | |
puts row['a1'] | |
end | |
end | |
conn.close |
This file contains 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
group :development, :test do | |
gem 'pry-rails' | |
gem 'pry-debugger' | |
gem 'pry-stack_explorer' | |
gem 'annotate' | |
gem 'quiet_assets' | |
gem 'better_errors' | |
# BetterErrors.editor = :sublime if defined? BetterErrors (initializer) |
This file contains 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
http://www.flickr.com/services/api/ | |
$.getJSON('http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=_______________________&text=' + search + '&per_page=500&page=' + page + '&format=json&jsoncallback=?', return_method); | |
"http://farm"+ item.farm +".static.flickr.com/"+ item.server +"/"+ item.id +"_"+ item.secret +"_m.jpg"; |
This file contains 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
$.ajax({ | |
dataType: 'json', | |
type: "GET", | |
url: "/data", | |
}).done(function( msg ) { | |
alert( "Data Saved: " + msg ); | |
}); |
This file contains 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
<!DOCTYPE html> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Foundation 4</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> |
This file contains 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
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{GOOGLEKEY}&sensor=false" %> | |
<div id="map"> | |
<div id="map_canvas"></div> | |
</div> | |
html { height: 100% } | |
body { height: 100%; margin: 0; padding: 0 } | |
#map |
This file contains 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
CarrierWave.configure do |config| | |
config.fog_credentials = { | |
:provider => 'AWS', # required | |
:aws_access_key_id => ENV['AWSKEY'], # required | |
:aws_secret_access_key => ENV['AWSSEC'], # required | |
:region => 'us-east-1' # optional, defaults to 'us-east-1' | |
} | |
# config.fog_directory = 'temp-cm' # required | |
config.fog_public = false # optional, defaults to true | |
# config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {} |