Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'postgres'
conn = PGconn.connect("localhost", 5432, '','', "db", "user", nil)
class ApplicationController < ActionController::Base
helper_method :admin?
helper_method :user?
protected
def admin?
session[:password] == 'imcool'
end
We couldn’t find that file to show.
<?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>
<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>