Skip to content

Instantly share code, notes, and snippets.

View keeperofthenecklace's full-sized avatar

Albert McKeever keeperofthenecklace

  • New Jersey, U.S.A
View GitHub Profile
source 'https://rubygems.org'
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'heroku'
gem 'newrelic_rpm'
@keeperofthenecklace
keeperofthenecklace / gist:3404632
Created August 20, 2012 14:15
Cucumber Testing Setup
$ rails new albertsproject
$ cd albertsproject
$ Add to gemfile
group :development, :test do
gem 'rspec-rails'
gem 'cucumber-rails'
gem 'capybara'
end
$ bundle install
$ rails generate --help **view generators
@keeperofthenecklace
keeperofthenecklace / MYSQL SHORTCUT KEYS
Last active September 10, 2023 14:50
MYSQL SHORTCUT KEYS
MYSQL
-----------
Run this on the command line. Not in mysql console.
eg. $alberta_makeever: mysql -u root -p user_development << sample.sql
mysql5 -u root -p
enter password:kwame1
mysql> exit;
Order.includes(:order_products).where("order_products.product_id = 16227").references(:order_products)
@keeperofthenecklace
keeperofthenecklace / Rails generator -h
Created August 20, 2012 00:15
Rails generator -h
it-macbook-albert:BDD_Testing albertmckeever$ rails generator integration_test -h (specific help)
it-macbook-albert:BDD_Testing albertmckeever$ rails generator -h
Usage: rails generate GENERATOR [args] [options]
General options:
-h, [--help] # Print generator's options and usage
-p, [--pretend] # Run but do not make any changes
-f, [--force] # Overwrite files that already exist
-s, [--skip] # Skip files that already exist
-q, [--quiet] # Suppress status output
Miscellenaeous
-------------------
cd ../..
pwd - displays path
grep -ir acts_as_json - display acts_as_jason in which file
gem list | grep rspec - list all rspec associated files
gem list | grep friendly_id
grep rspec Gemfile.lock - displays all rpec gem in the gemfile.lock. You shud b in dir.
Bundler Primary Command
Apple shortcut
---------------
alt + cmd + D - hide bar
cntl + alt + cmd + t - edit templete - contains all the shortcuts for the templates.
alt + cmd + right arrow - go to next file on tab
alt + cmd + down arrow - will open
ctrl + Shift + D - Duplicate line/selection - selected text is duplicated
cmd + ] - move block of code to right
@keeperofthenecklace
keeperofthenecklace / Debugging
Created August 19, 2012 14:23
Debugger Technique
#gemfile
gem 'debugger', group: [:development, :test]
#/app/controllers/tasks_controller.rb
def index
debugger
@today_tasks = Task.due_on(Date.today)
end
#terminal
@keeperofthenecklace
keeperofthenecklace / Grep Command
Last active October 8, 2015 21:48
Grep Commands
cd ../..
grep -Rni 'albert' .
pwd - displays path
grep -ir acts_as_json - display acts_as_jason in which file
gem list | grep rspec - list all rspec associated files
gem list | grep friendly_id
grep rspec Gemfile.lock - displays all rpec gem in the gemfile.lock. You shud b in dir.
bundle - install gems from gemfile
rvm help
@keeperofthenecklace
keeperofthenecklace / Github Cheat Sheet
Last active October 26, 2022 20:52
Github Cheat Sheet
Step B.) Creating a branch (and switching to the new branch in one line (Step 2)
**********
a.) git checkout -b [name of new branch]
eg. git checkout -b 2012Tryme
git fetch origin [remote-branch]:[new-local-branch] (Pulling a new branch from a remote repository)
b.) follow step 1
c.) git push origin 2012Tryme
** will add new branch to the repository on git hub
**********************
Step A.) Scheduling the addition of all files to the next commit (Step 1)
@keeperofthenecklace
keeperofthenecklace / routes.rb
Created August 18, 2012 20:21
config/routes.rb
resources :users
resources :sessions, only: [:new, :create, :destroy]
match '/signup', to: 'users#new'
match '/signin', to: 'sessions#new'
match '/signout', to: 'sessions#destroy', via: :delete
get "users/new"