Skip to content

Instantly share code, notes, and snippets.

View bjnewman's full-sized avatar

Ben Newman bjnewman

  • Availity
  • Portland
View GitHub Profile
@bjnewman
bjnewman / examples.html.erb
Last active September 13, 2016 14:32
Rails routing
Routing the Sinatra way vs Railsy way
http://guides.rubyonrails.org/routing.html
get '/posts/:id', to: 'posts#show', as: post
as option also lets you override the normal naming for the named route helpers
rake routes
Prefix Verb URI Pattern Controller#Action
@bjnewman
bjnewman / 1_ruby_quicksort.rb
Last active September 5, 2016 18:09
Here are some things you can do with Gists in GistBox.
# Use Gists to store entire functions
class QuickSort
def self.sort!(keys)
quick(keys,0,keys.size-1)
end
private
def self.quick(keys, left, right)