Skip to content

Instantly share code, notes, and snippets.

@nicalpi
nicalpi / devise.rb
Created October 13, 2011 11:04
Omniauth multiple facebook login strategy
# initializers/devise.rb
config.omniauth :facebook, [APP_ID], [APP_SECRET]
config.omniauth :facebook_app1, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email'
config.omniauth :facebook_app2, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email'
@nicalpi
nicalpi / 1.Gemfile
Created July 22, 2011 14:54
Creates easy shorten UUID in your RAILS APP
## See http://
gem 'base32-crockford', :require => 'base32/crockford'
@nicalpi
nicalpi / facebook_registration.rb
Created September 7, 2011 11:48
Testing Omniauth with Devise, Rspec and Capybara
background do
set_omniauth()
click_link_or_button 'Sign up with Facebook'
end
#Config is there http://github.com/spyou/vim-config
#Give a go to vimtutor in order to have a little overview of Vim.
"open/save"
#:w (save)
#:q (quit)
#:qa (quit all buffers)
#:q! (quit without saving)
#:wq (save and quit)
@nicalpi
nicalpi / gist:6070841
Created July 24, 2013 14:01
Is it possible to VimGolf this?
# To help me importing some CSV
# Using vim (to avoid eval hell)
# can we 'easily' move from something like
legacy_venue_id,venue_name,legacy_region_id,venue_address,venue_oot,venue_db,venue_notes
# To something like
legacy_venue_id = row[0]
venue_name = row[1]
gem 'resque', '>= 1.10.0'
gem 'heroku' # You will need the heroku gem for this too.
@nicalpi
nicalpi / helper.rb
Created September 29, 2011 16:07
Share with facebook url, with summary and title but no need of OG Data
def share_with_facebook_url(opts)
# Generates an url that will 'share with Facebook', and can includes title, url, summary, images without need of OG data.
#
# URL generate will be like
# http://www.facebook.com/sharer.php?s=100&p[title]=We also do cookies&p[url]=http://www.wealsodocookies.com&p[images][0]=http://www.wealsodocookies.com/images/logo.jpg&p[summary]=Super developer company
#
# For this you'll need to pass the options as
#
# { :url => "http://www.wealsodocookies.com",
@nicalpi
nicalpi / embed2.rb
Created July 7, 2011 08:46
test embed 2
def try_me
a = 12
end
@nicalpi
nicalpi / gist:1010363
Created June 6, 2011 14:27
result of first search
Search for? :paul or linux
Found 65 documents in total
** Pages: 3 **
*we cannot find anymore information for the moment*
** Interactions: 39 **
Type not provided
Type not provided