This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Outbound link tracking | |
* | |
* This code largely based on examples from | |
* [Google Analytics Help](http://www.google.com/support/googleanalytics/bin/answer.py?answer=55527). | |
* Modified to exclude local paths. Inspired by http://trevordavis.net/blog/use-jquery-to-open-all-external-links-in-a-new-window | |
*/ | |
*/ | |
jQuery(function($){ | |
$("a[href^='http']:not([href^='http://" + document.domain + "']):not([href^='http://www." + document.domain + "'])").click(function(event){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ******************************************************************************** | |
" Settings | |
" ******************************************************************************** | |
filetype off | |
filetype plugin indent on | |
syntax enable | |
syntax on " turns syntax highlighting on | |
if has("gui_running") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ObjectPrinter | |
def get_object(item=ObjectPrinter) | |
for method in item.public_instance_methods | |
puts method | |
puts "\n" | |
end | |
end | |
end | |
t = ObjectPrinter.new |