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 Employee < ActiveRecord::Base | |
end | |
class Manager < Employee | |
self.table_name = 'employees' | |
has_many :engineers | |
def nearest_manager | |
self | |
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
source ~/.dotfiles/vim/bundles " Bundles | |
2 | |
3 syntax on " Enable syntax highlighting | |
4 filetype plugin indent on " Enable filetype-specific indenting and plugins | |
5 | |
6 nnoremap Q <nop>| " disable EX mode | |
7 nnoremap q <nop>| " disable EX mode | |
8 nnoremap <Space> <nop>| " remove functionality from spacebar to allow leader to be spacebar | |
9 let mapleader = ' '| " leader is spacebar | |
10 nnoremap ; :| " remap ; to : |
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
function gs | |
2 git status $argv | |
3 end | |
4 | |
5 function gb | |
6 git branch $argv | |
7 end | |
8 | |
9 function gp | |
10 git push origin master $argv |
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
set -g __fish_git_prompt_show_informative_status 1 | |
set -g __fish_git_prompt_hide_untrackedfiles 1 | |
set -g __fish_git_prompt_color_branch magenta bold | |
set -g __fish_git_prompt_showupstream "informative" | |
set -g __fish_git_prompt_char_upstream_ahead "↑" | |
set -g __fish_git_prompt_char_upstream_behind "↓" | |
set -g __fish_git_prompt_char_upstream_prefix "" | |
set -g __fish_git_prompt_char_stagedstate "●" |
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
# modify the prompt to contain git branch name if applicable | |
2 git_prompt_info() { | |
3 ref=$(git symbolic-ref HEAD 2> /dev/null) | |
4 if [[ -n $ref ]]; then | |
5 echo "on branch %{$fg[red]%}${ref#refs/heads/}%{$reset_color%}" | |
6 fi | |
7 } | |
8 | |
9 setopt promptsubst | |
10 export PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}% $reset_color$fg[green]%~ $reset_color$(git_prompt_info) |
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
require 'spec_helper' | |
2 | |
3 describe Rectangle do | |
4 let(:good_point1) { Point.new(25,60) } | |
5 let(:good_point2) { Point.new(-35,170) } | |
6 let(:bad_point) { Point.new(-350,-350) } | |
7 let(:rectangle) { | |
8 input_pairs = "45,45,-50,-175" | |
9 Rectangle.from_input(input_pairs) | |
10 } |
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 SchoolTest < MiniTest::Test | |
def school | |
@school | |
end | |
def setup | |
@school = School.new | |
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
Bundler.require | |
require './lib/scrabble' | |
require './lib/player' | |
require 'minitest/autorun' | |
require 'minitest/pride' | |
class PlayerTest < MiniTest::Unit::TestCase | |
def test_a_player_accepts_a_name | |
player = Player.new("Katrina") |
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
Bundler.require | |
require './lib/scrabble' | |
require './lib/player' | |
require 'minitest/autorun' | |
require 'minitest/pride' | |
class PlayerTest < MiniTest::Unit::TestCase | |
def test_a_player_accepts_a_name | |
player = Player.new("Katrina") |
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
require 'ruby-processing' | |
class Visualizer < Processing::App | |
load_library "minim" | |
import "ddf.minim" | |
import "ddf.minim.analysis" | |
def setup |
NewerOlder