Skip to content

Instantly share code, notes, and snippets.

View helloluis's full-sized avatar
💭
Just shillin'

Luis Buenaventura helloluis

💭
Just shillin'
View GitHub Profile
@longlostnick
longlostnick / uploads_controller.rb
Created June 17, 2014 18:20
Rails JSON file upload with carrierwave (from base64 string)
class Api::UploadsController < ApiController
def create
@upload = Upload.new(upload_params)
ensure
clean_tempfile
end
private
@travisp
travisp / invitations_controller.rb
Created March 9, 2012 15:56
devise_invitable with omniauthable
class InvitationsController < Devise::InvitationsController
# GET /resource/invitation/accept?invitation_token=abcdef
def edit
if params[:invitation_token] && self.resource = resource_class.to_adapter.find_first( :invitation_token => params[:invitation_token] )
session[:invitation_token] = params[:invitation_token]
render :edit
else
set_flash_message(:alert, :invitation_token_invalid)
redirect_to after_sign_out_path_for(resource_name)
@boriscy
boriscy / install-ruby-debug-ubuntu-ruby-1.9.3
Created November 1, 2011 18:57
ruby-debug in ruby-1.9.3 and ubuntu
#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883
linecache19-0.5.13.gem
ruby_core_source-0.1.5.gem
ruby-debug19-0.11.6.gem
ruby-debug-base19-0.11.26.gem
#Then in your console
export RVM_SRC=/your/path/to/ruby-1.9.3