- Have a breakable toy side Rails project. It anchors your learning. Apply new skills/techniques here.
- Put the code in Github. Give mentors access to the project. They'll review your code.
- Understand the code review process and other style guidelines.
- Deploy your breakable toy to Heroku.
- Set learning goals weekly (e.g. X chapters of the Pickaxe, X Railscasts/week).
- Keep a text document (using vim) to record interesting commands/concepts/things you've learned.
- Review the text document daily for comprehension.
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
export_alias() { | |
local name=$1 | |
local alias_dir=$PWD/.direnv/aliases | |
mkdir -p "$alias_dir" | |
PATH_add "$alias_dir" | |
local target="$alias_dir/$name" | |
if declare -f "$name" >/dev/null; then | |
echo "#!/usr/bin/env bash" > "$target" | |
declare -f "$name" >> "$target" 2>/dev/null | |
echo "$@" >> "$target" |
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
# RSpec matcher for validates_with. | |
# https://gist.github.com/2032846 | |
# Usage: | |
# | |
# describe User do | |
# it { should validate_with CustomValidator } | |
# end | |
RSpec::Matchers.define :validate_with do |expected_validator, options| | |
match do |subject| | |
@validator = subject.class.validators.find do |validator| |
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 User < ActiveRecord::Base | |
has_one :subscription, dependent: :destroy | |
end | |
class Subscription < ActiveRecord::Base | |
acts_as_paranoid | |
belongs_to :user | |
enum plan: ServicePlans.plan_names |
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
# First, make sure that you have the most recent rvm. Several bugs with 2.0.0-preview1 | |
# have recently been fixed. | |
# | |
# Second, the openssl that comes with MacOS is too old for Ruby 2.0. You need to install | |
# a newer one with homebrew or the rvm pkg command. | |
# Option 1, with homebrew openssl: | |
brew update | |
brew install openssl |
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
BEFORE: start trajectory story | |
* run specific tests wrote (eg: rspec spec/decorators/event_decorator_spec.rb:5) | |
rake | |
git status | |
git diff |
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
on alfred_script(q) | |
set {the_path, file_name} to parse_path(first item of q) | |
tell application "iTerm" | |
set _terminal to make new terminal | |
tell _terminal | |
launch session "Vim" | |
tell the last session | |
write text "cd \"" & the_path & "\"" | |
# Replace e with your vim command |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
require 'json' | |
class Repo | |
def initialize(name) | |
@name = name | |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
require 'json' | |
class Repo | |
def initialize(name) | |
@name = name | |
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
# 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') |
NewerOlder