Skip to content

Instantly share code, notes, and snippets.

@pandabeat
pandabeat / Gemfile
Last active August 29, 2015 14:06 — forked from JBorts/Gemfile
# A sample Gemfile
source "https://rubygems.org"
gem 'rspec'
gem 'pry'
gem 'fastercsv'

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
def bubblesort(arr)
start_time = Time.now
swapped = true
puts "Bubblesort takes in #{arr} and spits out: "
while swapped
swapped = false
for i in 0..(arr.length-2) # avoids looking past array boundary
currentNum = arr[i].to_i
nextNum = arr[i+1].to_i
vagrant [vagrant]> pry
[1] pry(main)> def say_hi(name)
[1] pry(main)* puts "Hi, #{name}"
[1] pry(main)* end
=> nil
[2] pry(main)> say_hi("Chris")
Hi, Chris
=> nil
[3] pry(main)> money = 12.33
=> 12.33