Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am mdlima on github.
* I am mdlima (https://keybase.io/mdlima) on keybase.
* I have a public key ASBLJQN8mu3Lx7NFDEB5a1YJBo6ewXM7Y3LLyl3Ctk_siAo
To claim this, I am signing this object:
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
@mdlima
mdlima / piramid.rb
Created May 20, 2015 19:42
Piramid exercise - recursive
def piramid(size)
return [] if size < 1
out_piramid = piramid(size-1).map { |row| row += " ." }
return [" "*(size-1) + "."] + out_piramid
end
@mdlima
mdlima / Device Trace for "undefined method `to_key' for :user:Symbol"
Created April 13, 2011 18:35
This is the full trace for the "undefined method `to_key' for :user:Symbol", as written by rspec -v.
Failure/Error: post :create, :user => @attr
NoMethodError:
undefined method `to_key' for :user:Symbol
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/devise-1.2.1/lib/devise/rails/warden_compat.rb:18:in `serialize'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/warden-1.0.3/lib/warden/session_serializer.rb:25:in `store'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/warden-1.0.3/lib/warden/proxy.rb:161:in `set_user'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/devise-1.2.1/lib/devise/controllers/helpers.rb:116:in `sign_in'
# ./app/controllers/sessions_controller.rb:8:in `create'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'