Skip to content

Instantly share code, notes, and snippets.

@kurioscreative
kurioscreative / search.html.haml
Last active October 8, 2015 22:28
Geocoder: Over query limit Javascript Fix
= form_tag :search, method: :get, id:'search' do |f|
= text_field_tag :q, '', placeholder:'City, address, or zip code'
= hidden_field_tag :c, ''
= submit_tag "Go"
@kurioscreative
kurioscreative / production.rb
Created February 16, 2012 07:57
rack-rewrite for yesWWW (require www in url)
ExampleApp::Application.configure do
# Requires rack-rewrite: https://github.com/jtrupiano/rack-rewrite
config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
r301 /.*/, Proc.new {|path, rack_env| "http://www.#{rack_env['SERVER_NAME']}#{path}" }, :if => Proc.new {|rack_env| rack_env['SERVER_NAME'] !~ /www\./i}
end
#... the rest of production environment config.
end
@kurioscreative
kurioscreative / Outbound Link Tracking - Google Analytics.js
Created February 16, 2012 06:43 — forked from bigdawggi/Outbound Link Tracking - Google Analytics.js
jQuery-based outbound link tracking with cases for new window as well as same window locations
" ********************************************************************************
" Settings
" ********************************************************************************
filetype off
filetype plugin indent on
syntax enable
syntax on " turns syntax highlighting on
if has("gui_running")
@kurioscreative
kurioscreative / gist:803257
Created January 30, 2011 21:13
Learning Ruby : Puts methods for Class
class ObjectPrinter
def get_object(item=ObjectPrinter)
for method in item.public_instance_methods
puts method
puts "\n"
end
end
end
t = ObjectPrinter.new