The following is reference material, and not required reading. For a deeper understanding however it is recommended. For some topics, multiple links have been provided to give different explainations and viewpoints on the topics.
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
| class AddUniquenessIndexToYears < ActiveRecord::Migration | |
| def change | |
| add_index :years, [:award_id, :book_id], :unique => true | |
| end | |
| end |
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
| class Book < ActiveRecord::Base | |
| # Other stuff should go up here, the following is an example of attr_accessible to allow mass assignment | |
| # Mass assignment is when you do something like Book.create(title: "1984") | |
| attr_accessible :title | |
| end |
These need to be backed up by a migration to create the assemblies_parts table. This table should be created without a primary key:
class CreateAssembliesPartsJoinTable < ActiveRecord::Migration
def change
create_table :assemblies_parts, id: false do |t|
t.integer :assembly_id
t.integer :part_id
end
end
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
| # ----------------------------------------------------------------- # | |
| REFERENCES | |
| # ----------------------------------------------------------------- # | |
| http://ndpsoftware.com/git-cheatsheet.html | |
| # ----------------------------------------------------------------- # | |
| BASIC | |
| # ----------------------------------------------------------------- # |
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
| Macbook Pro:bash_example tibbon$ ls | |
| hello_world.rb lib | |
| Macbook Pro:bash_example tibbon$ ls -al | |
| total 0 | |
| drwxr-xr-x 4 tibbon staff 136 Jun 16 22:05 . | |
| drwxr-xr-x 151 tibbon staff 5134 Jun 16 22:04 .. | |
| -rw-r--r-- 1 tibbon staff 0 Jun 16 22:05 hello_world.rb | |
| drwxr-xr-x 3 tibbon staff 102 Jun 16 22:05 lib | |
| Macbook Pro:bash_example tibbon$ cd lib | |
| Macbook Pro:lib tibbon$ ls |
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
| This should probably be a blog post, but if I do that then I want to make it readable to others. | |
| Anyway, I want to get more awesome at the following things (which I already know a bit about each) | |
| - C | |
| - Haskell | |
| - Go | |
| - Python | |
| - Javascript | |
| - Postgres |
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
| Macbook Pro:chef-guide tibbon$ rake start | |
| vagrant up | |
| There was an error while executing `VBoxManage`, a CLI used by Vagrant | |
| for controlling VirtualBox. The command and stderr is shown below. | |
| Command: ["--version"] | |
| Stderr: dyld: Library not loaded: /Applications/VirtualBox.app/Contents/MacOS/VBoxRT.dylib | |
| Referenced from: /Applications/VirtualBox.app/Contents/MacOS/VBoxManage | |
| Reason: no suitable image found. Did find: |
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
| def test(x, get_user_ids, get_user_ids) | |
| get_user_ids.call(x) do | y | | |
| get_user_ids.call(y) | |
| end | |
| end | |
| def get_user_ids x | |
| for i in 1 .. 5 | |
| yield x * i | |
| end |
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
| def test(x, func1, func2) | |
| func1.call(x) do | y | | |
| func2.call(y) | |
| end | |
| end | |
| #change func1 to a method | |
| def func1 x | |
| for i in 1 .. 5 | |
| yield x * i |