I hereby claim:
- I am bswinnerton on github.
- I am bswinnerton (https://keybase.io/bswinnerton) on keybase.
- I have a public key whose fingerprint is B157 7B86 DC69 A3D1 AA57 3178 7274 3B7D E552 E25A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| " Put this in your .vimrc and whenever you `git commit` you'll see the diff of your commit next to your commit message. | |
| " For the most accurate diffs, use `git config --global commit.verbose true` | |
| " BufRead seems more appropriate here but for some reason the final `wincmd p` doesn't work if we do that. | |
| autocmd VimEnter COMMIT_EDITMSG call OpenCommitMessageDiff() | |
| function OpenCommitMessageDiff() | |
| " Save the contents of the z register | |
| let old_z = getreg("z") | |
| let old_z_type = getregtype("z") |
| module SerializableAttributes | |
| extend ActiveSupport::Concern | |
| included do | |
| class << self | |
| attr_reader :serializable_column | |
| end | |
| before_save :update_serializable_column |
#Ruby on Rails Office Hours - Session 2 ##Brewing your own server with Chef and Capistrano on Digital Ocean
Google hangout: http://www.youtube.com/watch?v=3W4kXyZWDJA
Real time chat: http://tlk.io/ror-study-group
Chef Notes: https://github.com/intercity/chef-repo
| class Fixnum | |
| def sam_prime? | |
| return false if self == 1 | |
| 2.upto(Math.sqrt(self).to_i) { |n| return false if self % n == 0 } | |
| return true | |
| end | |
| def refactored_prime? | |
| 2.upto(Math.sqrt(self).to_i) { |n| return false if self % n == 0 } | |
| self == 1 ? false : true |
| class Array | |
| def spiral | |
| array = [] | |
| array << self.shift | |
| array << self.transpose.reverse.spiral unless self.empty? | |
| array.flatten | |
| end | |
| end |
#Ruby on Rails Office Hours - Session 1
Google hangout: http://www.youtube.com/watch?v=NUSsraVYjcY
Real time chat: http://tlk.io/GA_ROR_study
The source code to this lecture can be found here: https://github.com/Ruby-on-Rails-Study-Group/tdd_blog
Feedback: https://docs.google.com/forms/d/1LHnYjyPbApbZ2ayPvWA3EIa4QcXhU61HX80LZlO4qSE/viewform
##Introduction
Brooks Swinnerton
| require 'rspec' | |
| describe 'fib(n)' do | |
| it 'calculates a fibonacci number based on index' do | |
| expect(fib(6)).to eq(8) | |
| end | |
| end | |
| def fib(n) |
| require 'rspec' | |
| describe 'is_prime?' do | |
| it 'calculates if a given number is prime' do | |
| expect(is_prime?(5)).to eq(true) | |
| end | |
| end | |
| describe 'prime(n)' do | |
| it 'calculates the nth prime' do |