Skip to content

Instantly share code, notes, and snippets.

View mikel's full-sized avatar

Mikel Lindsaar mikel

View GitHub Profile
@mikel
mikel / gist:2492063
Created April 25, 2012 18:37 — forked from thommahoney/gist:2491946
RailsConf 2012 Lightning Talks
1 min:
~Painless Javascript
koting hatduklgg
with wind tunnel
~tenderlove.dup jremsikjr
~iwanttolearnruby.com
(collecting resources for learning ruby)
@mikel
mikel / example.rb
Created May 25, 2012 03:04
Range Fun in Ruby
(-10..-5).include?(-7)
#=> true
(-5..-10).include?(-7)
#=> false
(10..5).include?(7)
#=> false
(5..10).include?(7)
#=> true
# OK, so maybe 10..5 wraps the whole set of integers?
@mikel
mikel / routes.rb
Created September 5, 2012 00:45
Subdomain Checker
Rails::Application.routes.draw do
# Limits the admin site only on the admin subdomain
constraints subdomain: /^admin/ do
ActiveAdmin.routes(self)
# Make resque only available to the admin users & redirect to admin login
# if trying to access resque without being logged in.
match('/admin/resque/admin/login' => redirect('/admin/login'))
authenticate :admin_user do
mount Resque::Server.new, :at => "/admin/resque"