Skip to content

Instantly share code, notes, and snippets.

View kritik's full-sized avatar

Vladimir Krylov kritik

  • PerfectLine
  • Tallinn, Estonia
View GitHub Profile
@tanelsuurhans
tanelsuurhans / gist:3930087
Created October 22, 2012 07:19
SHM calculation script
#!/usr/bin/env ruby
def halt
puts "----------------------------------"
puts " Usage "
puts "----------------------------------"
puts "./shm.rb <size> <units>"
puts "\tsize = integer > 0"
puts "\tunits = MB or GB"
exit
@PanosJee
PanosJee / refinery_omniauth.rb
Created March 17, 2011 22:58
Login / Register to Refinery with Omniauth (facebook, twitter, openid, etc)
# Create a role user (no perms). Fire up the console rails c
$> Role.create(:title=>'User')
# In your Gemfile add
gem 'oa-oauth', :require => 'omniauth/oauth'
# At the beginning of devise.rb. You can also create a yaml file and instantiate when Rails begin
# For shake of simplicity I added the credentials at devise.rb
Facebook = Rails.env.development? ? {:app_id => 2621xxx, :secret => 'e81f33d042xxxxx'} :
{:app_id => 1749xxx9, :secret => '13c11be6628dc1xxxx'}
# How to re-use the menu partial for a submenu in Refinery CMS >= 0.9.8.5 and < 0.9.9.22
# header menu (main menu) which hides its children.
<%= render :partial => "/shared/menu",
:locals => {
:dom_id => 'menu',
:css => 'menu',
:collection => @menu_pages,
:hide_children => true
} -%>