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
#!/bin/sh | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by [email protected] http://github.com/jaygooby | |
# based on http://gist.github.com/308216 by http://github.com/mguterl | |
# | |
## A sample /etc/unicorn/my_app.conf | |
## |
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
# README | |
# pass in this file when creating a rails project | |
# | |
# for example: | |
# rails _3.2.14_ new awesome_app -d postgresql -m ~/kickhash_template.rb | |
remove_file "README.rdoc" | |
create_file "README.md", "TODO" | |
gem_group :development, :test do |
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
# README | |
# pass in this file when creating a rails project | |
# | |
# for example: | |
# rails _3.2.14_ new awesome_app -d postgresql -m ~/kickhash_template.rb | |
remove_file "README.rdoc" | |
create_file "README.md", "TODO" | |
gem 'rspec-rails', group: [:test, :development] |
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
development: | |
adapter: postgresql | |
encoding: unicode | |
database: <%= File.basename(Rails.root) %>_development | |
pool: 5 | |
host: localhost | |
username: <%= ENV['PG_USERNAME'] %> | |
password: | |
test: |
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
#Gemfile | |
group :development, :test do | |
gem 'pry-rails' # Causes rails console to open pry | |
# https://github.com/rweng/pry-rails | |
gem 'pry-debugger' # Adds step, next, finish, and continue commands and breakpoints | |
# https://github.com/nixme/pry-debugger | |
gem 'pry-stack_explorer' # Navigate the call-stack | |
# https://github.com/pry/pry-stack_explorer | |
gem 'annotate' # Annotate all your models, tests, fixtures, and factories | |
# https://github.com/ctran/annotate_models |
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
before do | |
ActiveRecord::Base.logger = Logger.new( STDOUT ) | |
ActiveRecord::Base.establish_connection( | |
:adapter => "postgresql", | |
:host => "localhost", | |
:username => "Ducky", | |
:password => "", | |
:database => "instagram_db" | |
) |
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
def game(input1, input2) | |
if input1 == input2 | |
outcome = "It's a tie!" | |
elsif input1 == "rock" | |
if input2 == "paper" | |
outcome = "Paper covers rock. Player 1 loses!" | |
elsif input2 == "scissors" | |
outcome = "Rock smashes scissors. Player 1 wins!" | |
end | |
elsif input1 == "paper" |
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
class Apartment | |
attr_accessor :price, :sqft, :num_beds, :num_baths, :renters, :apartment_number, :building | |
def initialize(apartment_number, sqft, num_beds, num_baths) | |
@apartment_number = apartment_number | |
@sqft = sqft | |
@num_beds = num_beds | |
@num_baths = num_baths | |
@price = (50 * sqft) + (1000 * num_baths) + (2000 * num_beds) | |
@tenants = {} | |
@building = "" |
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
students = [ # Array of students' names. | |
"Alex Hint", | |
"Amy Ruan", | |
"Ana Giraldo-Wingler", | |
"Cooper Mayne", | |
"Diego Palma", | |
"Edward Shin", | |
"Enoch Riese", | |
"Harrison Powers ", | |
"Jaclyn Jimenez", |
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
module LastN | |
def last(n) | |
self[-n,n] | |
end | |
end | |
# Defines a module that calls certain range on object. | |
class String | |
include LastN | |
end |
NewerOlder