Skip to content

Instantly share code, notes, and snippets.

View matiaskorhonen's full-sized avatar

Matias Korhonen matiaskorhonen

View GitHub Profile
module ApplicationHelper
# Facebook Like button
def like_button_tag(url)
content_tag :iframe, nil, { :'data-url' => "http://www.facebook.com/plugins/like.php?href=#{URI::escape(url)}&layout=standard&show_faces=false&width=400&action=like&colorscheme=light&height=35",
:scrolling => "no",
:frameborder => "0",
:style => "border:none; overflow:hidden; width:400px; height:35px;",
:allowTransparency => "true" }
end
~/Programming/fooproject[master]% gem install faraday
Successfully installed fakutori-san-0.1.0
1 gem installed
@matiaskorhonen
matiaskorhonen / gist:706413
Created November 19, 2010 11:47
gem install -V
~/Programming/foobar[master]% gem install faraday -V
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
304 Not Modified
Installing gem fakutori-san-0.1.0
/Users/matt/.rvm/gems/ruby-1.9.2-p0/gems/fakutori-san-0.1.0/.gitignore
/Users/matt/.rvm/gems/ruby-1.9.2-p0/gems/fakutori-san-0.1.0/.kick
/Users/matt/.rvm/gems/ruby-1.9.2-p0/gems/fakutori-san-0.1.0/MIT-LICENSE
/Users/matt/.rvm/gems/ruby-1.9.2-p0/gems/fakutori-san-0.1.0/README.rdoc
@matiaskorhonen
matiaskorhonen / railsconf_2010_sessions.json
Created February 8, 2011 18:11
A JSON formatted list of sessions at RailsConf 2010. Sorted by average rating.
[
{
"url": "http://en.oreilly.com/rails2010/public/schedule/detail/15528",
"error": "undefined method `text' for nil:NilClass",
"rating": 0,
"votes": 0
},
{
"url": "http://en.oreilly.com/rails2010/public/schedule/detail/15342",
"error": "undefined method `text' for nil:NilClass",
# This works:
respond_with :admin, @patent
# This DOES NOT work:
respond_with [:admin, @patent]
puts "test!"
@matiaskorhonen
matiaskorhonen / gist:985340
Created May 22, 2011 10:32
Horrible, horrible URL
https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-127-24^1131_4000_100__&jumpid=go/qualitycenter
@matiaskorhonen
matiaskorhonen / rip-off.textile
Created June 11, 2011 20:50
Kisko Labs site rip-offs
@matiaskorhonen
matiaskorhonen / irb_context_echo.rb
Created October 13, 2011 09:31
A common irb complaint is that its output is too verbose. Disabling this option makes irb print no output.
irb_context.echo = false
# More config options:
# http://tagaholic.me/2009/05/29/exploring-how-to-configure-irb.html
@matiaskorhonen
matiaskorhonen / link_to_with_confirm.rb
Created December 5, 2011 21:20
Prettier Rails confirmation dialogs