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
# just FYI, ApplicationRecord is a new rails 5 thing, | |
# It is a superclass for your models that inherit from ActiveRecord::Base | |
# It's purpose is to reduce the need for monkey patching ActiveRecord::Base directly | |
class Person < ApplicationRecord | |
belongs_to :account | |
end | |
class Account < ApplicationRecord | |
has_many :users |
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
Every programming language has some kind of way of doing numbers and math. | |
This exercise his all about math and the symbols needed to do math. | |
Let's name them right away so you know what they are called. As you type this one in, say the name. | |
When saying them feels boring you can stop saying them. Here are the names: | |
+ plus | |
- minus | |
/ slash |
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
# Exercise 1: A Good First Program | |
In Sublime, create a new file, call it ```lesson_1.rb``` | |
Type the following text | |
```puts "Hello World!"``` | |
```puts "Hello Again"``` |
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
VIM Cheatsheet | |
Text Entry | |
a Append text following current cursor position | |
A Append text to the end of current line | |
i Insert text before the current cursor position | |
I Insert text at the beginning of the cursor line | |
o Open up a new line following the current line and add text there | |
O Open up a new line in front of the current line and add text there |
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
" Leader | |
let mapleader = " " | |
set t_Co=256 | |
set backspace=2 " | |
let &colorcolumn="80" | |
set nocompatible " Use Vim settings, rather then Vi settings | |
set nobackup | |
set nowritebackup | |
set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287 |
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
=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 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
CarrierWave.configure do |config| | |
config.fog_credentials = { | |
:provider => 'AWS', # required | |
:aws_access_key_id => 'xxx', # required | |
:aws_secret_access_key => 'yyy', # required | |
:region => 'eu-west-1', # optional, defaults to 'us-east-1' | |
:host => 's3.example.com', # optional, defaults to nil | |
:endpoint => 'https://s3.example.com:8080' # optional, defaults to nil | |
} | |
config.fog_directory = 'name_of_directory' # required |
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
# put all new_layout views in the following new folder: app/views_new_layout | |
## Do NOT put the views in app/views | |
# you need a migration in Users called new_layout:boolean this does not need a default value | |
## The below code will assume the new layout for all users, unless they explicitly say no. | |
### for example, if you want to put an ajax box at the top of the new page that says | |
#### "This is our new layout. Switch back to old one? If they click the link, then it sets the boolean to false. | |
##### You can also have them switch back and forth easily. If they make no preference (thus the boolean is nil,) then new layout is used. | |
# You can reverse this logic very easily if you want to default to the old layout. | |
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
//global variable used for SHOP upload functionality var myView = null; var agentBrokerSAMLToken=null; var postCCRApplicantIDToken=null; var postCCRAppIDToken=null; var postCCRState=null; var agentEmailUUID =null; $(function($) { var tenantId = 'global'; var locale = 'en_US'; var resources = {}; var environment = ''; var envReference = 'Production'; resources['ffe.ee.shared.validation.required'] = '0 is required.'; resources['ffe.ee.shared.dropdown.relation.january'] = 'January'; resources['ffe.ee.shared.formValidator.eeChoose'] = 'Choose "individual," "SHOP," or "both."'; resources['ffe.ee.shared.dropdown.docType.immigrantVisa'] = 'Machine Readable Immigrant Visa (with Temporary I-551 Language)'; resources['ffe.ee.shared.nav.subNav.reviewAndConfirm'] = 'Review & Confirm'; resources['ffe.ee.shared.exceptions.400.403'] = 'Invalid XML Request'; resources['ffe.ee.shared.exceptions.400.401'] = 'Missing action URI'; resources['ffe.ee.shared.exceptions.400.400'] = 'Missing Taskname'; resources['ffe.ee.shared.label. |
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
$ pg_resetxlog /usr/local/var/postgres | |
pg_resetxlog: lock file "/usr/local/var/postgres/postmaster.pid" exists | |
Is a server running? If not, delete the lock file and try again. | |
$ rm /usr/local/var/postgres/postmaster.pid | |
$ pg_resetxlog /usr/local/var/postgres | |
The database server was not shut down cleanly. | |
Resetting the transaction log might cause data to be lost. | |
If you want to proceed anyway, use -f to force reset. | |
$ pg_resetxlog -f /usr/local/var/postgres | |
Transaction log reset |
NewerOlder