Skip to content

Instantly share code, notes, and snippets.

@Tasha25
Tasha25 / drill.md
Created September 25, 2013 14:43
Drills for day 3 during week 1

Drill!

###On your computer Create a new folder in ~/ga_wdi called drills Initalize a new git repo in drills Add a Ruby file called first_date.rb Add and commit the file

###On Github Create a new repo called drills

@Tasha25
Tasha25 / Useful gems for development
Created October 17, 2013 13:25
Useful gems for development
#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
@Tasha25
Tasha25 / A reusable gist for database.yml
Created October 17, 2013 13:45
A reusable gist for database.yml
development:
adapter: postgresql
encoding: unicode
database: <%= File.basename(Rails.root) %>_development
pool: 5
host: localhost
username: <%= ENV['PG_USERNAME'] %>
password:
test:
@Tasha25
Tasha25 / gist:7103282
Created October 22, 2013 15:59
This will help to configure rspec in documentation
# Configure Rspec to print nice
RSpec.configure do |config|
# Use color in STDOUT
config.color_enabled = true
# Use color not only in STDOUT but also in pagers and files
config.tty = true
# Use the specified formatter
config.formatter = :documentation # :progress, :html, :textmate
# immediately stop running upon first failure
config.fail_fast = true
@Tasha25
Tasha25 / Git Clone
Created November 13, 2013 13:52
Steps to pulling a git file
Example of Git Cloning
mkdir Projects
cd Projects
git clone git@github.com:ml242/courtPO.git
cd courtPO
cd courtPO //just in case it is two files deep
bundle install // You need to install any gems
rake db:create //create database
rake db:migrate // migrate any models
@Tasha25
Tasha25 / Steps to create a repo
Created November 13, 2013 14:15
Ways to create a repo off of an existing project.
Create a new Repository aside from the one that already exists for a project.
Go into the file you want to push up.
ex: CourtPOv1
Get the git name and push up to it in the terminal. I substitute tasha for origin. That can be anything you want it to be.
$ git remote add tasha git@github.com:Tasha25/CourtPOv1.git
@Tasha25
Tasha25 / Paperclip rough draft
Created November 13, 2013 18:39
Paperclip for images draft.
rails new app
rake db:create; rake db:migrate
Added new input fied so you can add photos.
If you have folder you can just click on the button and we will upload it
@Tasha25
Tasha25 / Another version for session
Created November 14, 2013 00:03
Fully explain session
## This is saying the same thing
def current_user
if session[:user_id]
@current_user ||= User.find(session[:user_id])
end
end
helper_method :current_user
@Tasha25
Tasha25 / Nothing
Created November 14, 2013 01:19
Having people not get to the edit page unless authorized
Nothing to add
@Tasha25
Tasha25 / Rspec and Guard
Created November 19, 2013 00:11
Rspec and Guard in order to run rspec
Go into the folder you want rspec to run in
$ rspec --init
Go into folder
$cd spec/
Create your files that will end with the '_spec.rb'
ex: "school_spec.rb"