Skip to content

Instantly share code, notes, and snippets.

View chyld's full-sized avatar
:electron:
import numpy

Chyld Medford chyld

:electron:
import numpy
View GitHub Profile
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
RSpec.configure do |config|
config.color_enabled = true
config.tty = true
config.formatter = :documentation
end
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
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
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)
@chyld
chyld / flickr.js
Last active December 14, 2015 06:39
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";
$.ajax({
dataType: 'json',
type: "GET",
url: "/data",
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
<!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 %>
<%= 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
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 {}