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
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) |
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
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) |
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
# First attempting to use Capybara directly, you will ran into issues when trying to set HTTP header. | |
# Using Basic HTTP Authentication requires that we needed to set the header. | |
# Also we need to set the Content-Type and Accept headers to ensure that Rails handles the input and output correctly. | |
# When using Rack, Capybara delegates request and response handling down to Rack::Test. | |
# So I used Rack::Test directly in my step definitions, and it works. | |
# Rack::Test has a module called Rack::Test::Methods that can be mixed into a class to provide it | |
# with methods for get, post, put, delete as well as last_request, last_response, header and more. | |
# I mixed Rack::Test::Methods into the Cucumber world at the top of our API steps file like so: | |
############################## |
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
rake test TEST=test/models/admin_ability_test.rb |
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
CTRL Ww moves you from window to window ( | |
CTRL WT moves current window into a tab | |
t (While in nerdtree) opens the file in a tab. | |
gt Goes to next tab. | |
gT Goes to previous tab. | |
\n Toggles the NerdTree on or off. | |
Command T - find in project. |
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
new_record? | |
any? | |
kind_of? | |
include? | |
nil? | |
blank? | |
clear? | |
empty? |
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
ActiveRecord | |
----------- | |
SERIALIZED ATTRIBUTE | |
$ rails c --sandbox or rails c development | |
#create class method | |
$ user = User.create( name" "albert", email: "kotn_ep1@hotmail.com" ) | |
#new class method |
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
$ IRB ****Let you into Ruby Interpreter | |
1.9.3-p194 :088 > use TAB key to autocomplete. | |
1.9.3-p194 :089 > help | |
Enter the method name you want to look up. | |
You can use tab to autocomplete. | |
Enter a blank line to exit. |
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
cd into directory of the Ruby.rb file... | |
it-macbook-albert:karoake albertmckeever$ IRB | |
1.9.3-p194 :001 > load 'song.rb' | |
=> true |
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
Esc shft + b - moves cursor(c) BACK to begin of a text. eg. (c)albert (c)mckeever (c)help | |
Esc shft+ f moves cursor(c) FORWARD to begin of a text. eg. (c)albert (c)mckeever (c)help | |
shft + cmd - selects all | |
Ctrl+A and Ctrl+E - home and end | |
Ctrl+U: This clears the entire line so you can type in a completely new command. | |
Ctrl+K: This deletes the line from the position of the cursor to the end of the line. | |
Ctrl+W: This deletes the word before the cursor only. | |
Ctrl+R: This lets you search your command history for something specific. | |
Tab: autocomplete |
NewerOlder