This file contains hidden or 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
| <!doctype html> | |
| <html lang='en'> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <meta name="description" content="My Description"> | |
| <meta name="keywords" content="keyword1, keyword2"> | |
| <meta name="author" content="Gene M. Angelo, Jr."> |
This file contains hidden or 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
| # *** ATTENTION *** | |
| # Be sure to run the below generator after updating the below files: | |
| # $ rails generate bootstrap:install less --no-coffeescript -p | |
| # $ rails generate rspec:install -p | |
| # *** ATTENTION *** | |
| # | |
| # /Gemfile | |
| # Gems to add bootstrap, jquery using less, and font-awesome-rails. |
This file contains hidden or 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
| # Fizz buzz | |
| # Range 1 -> 100 (inclusive) | |
| # If divisible by 3, output fizz | |
| # If divisible by 5, output buzz | |
| # If divisible by 3 and 5, output fizzbuzz | |
| FIZZ = 'fizz'.freeze | |
| BUZZ = 'buzz'.freeze | |
| FIZZBUZZ = (FIZZ + BUZZ).freeze |
This file contains hidden or 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
| // | |
| // UIDesignableXibExample.swift | |
| // | |
| // Created by Gene M. Angelo Jr. on 12/8/16. | |
| // Copyright © 2016 Mohojo Werks LLC. All rights reserved. | |
| // | |
| import UIKit | |
| @IBDesignable class UIDesignableXibExample: UIView { |
This file contains hidden or 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
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
This file contains hidden or 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
| Flash[:notice] vs. Flash.now[:notice] | |
| ============================================ | |
| Flash[:notice] - message will persist to the next action and should be used when redirecting to another action via the 'redirect_to' method. | |
| Flash.now[:notice] - message will be displayed in the view your are rendering via the 'render' method. | |
| Log and watch messages logged realtime | |
| ============================================ | |
| # In my code... |
This file contains hidden or 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
| # | |
| # What's this do? | |
| # | |
| # Keep your test database clean whilst testing, using database_cleaner, rspec-rails and capybara. | |
| # | |
| # Instructions: | |
| # | |
| # Place this file in spec/support | |
| # | |
| # Assumptions: |
This file contains hidden or 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
| =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') |
This file contains hidden or 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
| # | |
| # A DRY Capybara helper method that can be used in multiple Capybara features (specs). | |
| # Place this file in spec/support; the file name can be arbitrary (e.g. you can name your file anything). | |
| module CapybaraHelpers | |
| def sign_up | |
| visit signup_path # '/signup' | |
| within(".form-container") do | |
| fill_in 'Name', with: 'Gene Angelo' | |
| fill_in 'User Name', with: 'gangelo' | |
| fill_in 'Email', with: '[email protected]' |
This file contains hidden or 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
| # Warning: This is NOT a replacement for your current ~/.bash_profile file. The below script | |
| # is meant to be added to the bottom of your current ~/.bash_profile file. | |
| # | |
| # APPEND (do not replace!) the below script to your current ~/.bash_profile file. | |
| # | |
| # | |
| # Requirements |