This file contains 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
<script> | |
src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=abc" | |
type="text/javascript"> | |
</script> | |
GENERATES (what I want): | |
<script> | |
" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=abc" type="text/javascript"> " | |
</script> |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.apache.httpd</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/httpd/bin/apachectl</string> | |
<string>start</string> |
This file contains 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 ApplicationController < ActionController::Base | |
helper_method :admin? | |
helper_method :user? | |
protected | |
def admin? | |
session[:password] == 'imcool' | |
end | |
This file contains 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
require 'rubygems' | |
require 'postgres' | |
conn = PGconn.connect("localhost", 5432, '','', "db", "user", nil) |
This file contains 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
def route_to_poly_controller(polymorphic_type, polymorphic_id, action = :show) | |
return {:controller => polymorphic_type.tableize, :action => action, :id => polymorphic_id} | |
end |
This file contains 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
DateTime::DAYNAMES[DateTime::ABBR_DAYNAMES.index("Sun")].downcase |
This file contains 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
def html_safe_ajax_partial(name, partial, div) | |
link_to_remote name, :url => new_session_url(:partial => partial, :format => 'js'), :update => div, :method => :get, :html => { :href => new_session_url(:partial => partial) } | |
end | |
#html_safe_ajax_partial('Hello', 'hi', 'coolstuff') | |
#The above properly generates http://domain/session/new?partial=hi in the coolstuff div with text 'Hello' | |
#<a onclick="new Ajax.Updater('page_contents', 'http://localhost:3001/session/new.js?partial=hi', {asynchronous:true, evalScripts:true, method:'get', parameters:'authenticity_token=' + encodeURIComponent('U44dXFOJa2g4cpjYTL+SwSySN3lh0jo9dD8joocNEgo=')}); return false;" href="http://localhost:3001/session/new?partial=about">Hello</a> | |
#I want one to generate: | |
#<a onclick="new Ajax.Updater('page_contents', 'http://localhost:3001/session/new.js?partial=hi', {asynchronous:true, evalScripts:true, method:'get', parameters:'authenticity_token=' + encodeURIComponent('U44dXFOJa2g4cpjYTL+SwSySN3lh0jo9dD8joocNEgo=')}); return false;" |
This file contains 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
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
timeout: 5000 | |
test: | |
adapter: sqlite3 | |
database: db/test.sqlite3 | |
timeout: 5000 |
This file contains 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
def create | |
@custom_errors = Array.new | |
@chain = current_user.chain | |
@chain.advertisers.each { |advertiser| | |
@deal = Deal.new(params[:deal]) | |
@deal.advertiser_id = advertiser.id | |
@deal.advertiser.ripper = false | |
@deal.advertiser.category_id = advertiser.category.parent_id | |
@deal.advertiser.category_parent_id = advertiser.category.parent_id | |
if @deal.save |
OlderNewer