Skip to content

Instantly share code, notes, and snippets.

View tonyc's full-sized avatar
💭
wondering why github decided to add a user status

Tony Collen tonyc

💭
wondering why github decided to add a user status
View GitHub Profile
<form id="addSpeaker">
<fieldset>
<legend>Speaker Info</legend>
Name: <input type="text" id="name" /> <br />
Bio: <textarea id="bio"></textarea> <br />
Twitter Handle: <input type="text" id="twitterHandle" /> <br />
State: <input type="text" id="state" /> <br />
Photo Url: <input type="text" id="photoUrl" />
</fieldset>
<fieldset>
@tonyc
tonyc / cancan_exposure.rb
Created December 16, 2011 22:05 — forked from mrmemes-eth/cancan_exposure.rb
A default exposure for decent_exposure that assigns instance variables (to make cancan happy)
default_exposure do |name|
collection = name.to_s.pluralize
if respond_to?(collection) && collection != name.to_s && send(collection).respond_to?(:scoped)
proxy = send(collection)
else
proxy = name.to_s.classify.constantize
end
instance_variable_set("@#{name}") = if id = params["#{name}_id"] || params[:id]
proxy.find(id).tap do |r|
@tonyc
tonyc / Japanese style
Created August 25, 2011 16:35 — forked from endolith/Has weird right-to-left characters.txt
Unicode smileys emoticons
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
@tonyc
tonyc / sections_controller.rb
Created June 7, 2011 15:29 — forked from marcelloma/sections_controller.rb
decent_exposure + meta_search + cancan
class SectionsController < ApplicationController
load_and_authorize_resource
expose(:section)
expose(:sections) { search.paginate(:page => params[:page]) }
expose(:search) { Section.search(params[:search]) }
def create
if section.save
@tonyc
tonyc / bates.css
Created June 3, 2011 18:40 — forked from markoa/bates.css
CSS file as seen on Railscasts
body {
background-color: #4B7399;
font-family: Verdana, Helvetica, Arial;
font-size: 14px;
}
a img {
border: none;
}