Skip to content

Instantly share code, notes, and snippets.

View anaerobeth's full-sized avatar

Beth Tenorio anaerobeth

  • Salem, NH
View GitHub Profile
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
# spec/support/authentication_helper.rb
module AuthenticationHelper
def sign_in_as(user)
visit new_user_session_path
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_button "Sign in"
function rails_pg() {
rails new $1 -T --database=postgresql &&
cd $1 &&
echo $1 > .ruby-gemset &&
echo 2.0 > .ruby-version &&
echo /config/database.yml >> .gitignore &&
cp config/database.yml config/database.example.yml &&
add_rails_gems &&

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@anaerobeth
anaerobeth / Notes on Railscasts #48 Console Tricks
Last active December 19, 2015 22:19
Notes on Railscasts #48 Console Tricks (revised)
On the Terminal:
rails console #open a terminal window
rails c --sandbox #console session that is wrapped in a transaction and can be rolled back
rails c --production #start the app in the production environment
Console methods:
> app
Opening a tumblr blog
Go to https://www.tumblr.com
Click Sign Up
Enter your email, password and username
Enter your age and click on agree button
Check your email and verify your account
Log in to your Tumblr
Add photos, text, links or whatever content you want by clicking on the icons
http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/
Plaintext Text Objects
Vim provides text objects for the three building blocks of plaintext: words, sentences and paragraphs.
Words
aw – a word (includes surrounding white space)
iw – inner word (does not include surrounding white space)
@anaerobeth
anaerobeth / Vim Tips
Created April 5, 2013 15:07
Collection of vim tips and links
http://stackoverflow.com/questions/2573/vim-tutorials
y(ank) - copy
d(elete) - cut
c(hange) - replace
p(aste) - put from buffer after cursor
o(pen) - start a new line
i(nsert) - insert before current character
a(ppend) - insert after current character
w(ord) - moves to beginning of next word