Skip to content

Instantly share code, notes, and snippets.

View CamonZ's full-sized avatar

Rafael Simon Garcia CamonZ

View GitHub Profile
@CamonZ
CamonZ / url_dsl.rb
Created December 14, 2009 20:05 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
@CamonZ
CamonZ / my.god
Created September 8, 2009 07:07 — forked from nofxx/my.god
#
# God please,
#
# Generic Monitor
#
def generic_monitoring(w, options = {})
w.interval = 30.seconds # default
w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 10.seconds
@CamonZ
CamonZ / _form.html.haml
Created September 8, 2009 00:27
Polymorphic Autosave Associations with Paperclip
= f.error_messages
%div{:style=>"padding-bottom:20px"}
%div
= f.label :name, 'Nombre del producto'
%br
= f.text_field :name, :size => 70
#clientdesc
%div
= f.label :excerpt, 'Resumen del producto'
%br
@CamonZ
CamonZ / gist:180122
Created September 3, 2009 03:47 — forked from linojon/gist:180120
before_filter :newer_browser_required
def newer_browser_required
# ref http://pastie.org/203799
# reject MSIE 5.0 and MSIE 6.0
browser_access_denied if request.user_agent =~ /msie\s+[5,6]\.\d+/i
end
def browser_access_denied