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
# app/models/credit_card.rb | |
class CreditCard < ActiveRecord::Base | |
belongs_to :user | |
... | |
def make_default! | |
old = self.users.credit_cards.where(default: true).first |
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
# Model | |
class Job | |
include MongoMapper::Document | |
key :title, String | |
key :description, String | |
end | |
# Controller |
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
[1, 2, 3, 4].slice(3) #=> 4 | |
[1, 2, 3, 4].slice(4) #=> nil | |
[1, 2, 3, 4].slice(5) #=> nil | |
[1, 2, 3, 4].slice(4, 1) #=> [] | |
[1, 2, 3, 4].slice(5, 1) #=> nil |
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
# Routes | |
Prefix Verb URI Pattern Controller#Action | |
sidekiq_web /sidekiq Sidekiq::Web | |
root GET / high_voltage/pages#show {:id=>"home"} | |
user_bank_accounts GET /users/:user_id/bank_accounts(.:format) bank_accounts#index | |
POST /users/:user_id/bank_accounts(.:format) bank_accounts#create | |
new_user_bank_account GET /users/:user_id/bank_accounts/new(.:format) bank_accounts#new | |
edit_user_bank_account GET /users/:user_id/bank_accounts/:id/edit(.:format) bank_accounts#edit | |
user_bank_account GET /users/:user_id/bank_accounts/:id(.:format) bank_accounts#show | |
PATCH /users/:user_id/bank_accounts/:id(.:format) bank_accounts#update |
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
Cleaning up... | |
Removing temporary dir /home/brandon/Code/rhombik-env/build... | |
Exception: | |
Traceback (most recent call last): | |
File "/home/brandon/Code/rhombik-env/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main | |
status = self.run(options, args) | |
File "/home/brandon/Code/rhombik-env/local/lib/python2.7/site-packages/pip/commands/install.py", line 302, in run | |
requirement_set.cleanup_files(bundle=self.bundle) | |
File "/home/brandon/Code/rhombik-env/local/lib/python2.7/site-packages/pip/req.py", line 1333, in cleanup_files | |
rmtree(dir) |
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
# Original line | |
%img.popup-menu-shadow-leftcap{:src=>"../assets/popup-menu-shadow-leftcap.gif", :alt=>''} | |
# Try this instead | |
= image_tag 'popup-menu-shadow-leftcap.gif', class: 'popup-menu-shadow-leftcap', alt: '' |
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
/heres a simple div with an id | |
#my-div This is my cool div | |
results: <div id="my-div">This is my cool div</div> | |
/heres a simple div with a class | |
.my-div This is my cool div |
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
## Cucumber Scenario | |
@wip | |
Scenario: Login with correct details | |
Given a user named "brent" exists | |
When I go to login | |
And I fill in "Username" with "brent" | |
And I fill in "Password" with "screech" | |
And I press "Log In" | |
# And show me the page |
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
MacBook-Pro:weblog brandon$ bundle install | |
Fetching source index for http://rubygems.org/ | |
Using rake (0.8.7) | |
Using abstract (1.0.0) | |
Using activesupport (3.0.0) | |
Using builder (2.1.2) | |
Using i18n (0.4.1) | |
Using activemodel (3.0.0) | |
Using erubis (2.6.6) | |
Using rack (1.2.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
<?php | |
/** | |
* Library for using Authorize.net's ARB (automated recurring billing) | |
* | |
* @author Brandon Cordell(brandon@leadandrock.com) | |
* @link http://projects.leadAndrock.com/cake_arb | |
* @copyright Copyright (c) 2010, Brandon Cordell | |
* @version 1.0 | |
* |
OlderNewer