Skip to content

Instantly share code, notes, and snippets.

(function($) {
$("#assign_pub_to_trans").click(function(){
$(this).removeClass("unselected").addClass("selected").val("1");
$("#assign_age_to_trans").removeClass("selected").addClass("unselected").val("0");
});
$("#assign_age_to_trans").click(function(){
$(this).removeClass("unselected").addClass("selected").val("1");
$("#assign_pub_to_trans").removeClass("selected").addClass("unselected").val("0");
@quirkey
quirkey / way 1.js
Created April 26, 2009 20:26 — forked from mrb/gist:102144
var Favorite = {
client_name: "",
client_id: "",
user_id: "",
add_or_remove: "",
getID: function(params){
this.client_name = params.attr("client_name");
this.client_id = params.attr("client_id");
this.user_id = params.attr("user_id");
@quirkey
quirkey / irb
Created April 22, 2009 12:43 — forked from bmizerany/irb
[08:48 AM:gist-99771(master)] $ irb -rubygems -r myapp.rb -r rack/test
>> app = Rack::Test::Session.new(Sinatra::Application)
=> #<Rack::Test::Session:0x17e8820 @headers={}, @app=Sinatra::Application>
>> app.get '/'
=> #<Rack::Response:0x17ad4dc @block=nil, @writer=#<Proc:0x0189f7b4@/opt/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/response.rb:24>, header{"Content-Type"=>"text/html", "Content-Length"=>"7"}, body["testing"], length7, status200
>> app.body
NoMethodError: undefined method `body' for #<Rack::Test::Session:0x17e8820>
from (irb):3
Let's make a list of Sinatra-based apps!
Apps:
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com"
- http://github.com/rtomayko/wink "minimalist blogging engine"
- http://github.com/foca/integrity "The easy and fun Continuous Integration server"
- http://github.com/sr/git-wiki "git-powered wiki"
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits."
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>."
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!"
@quirkey
quirkey / snippet.rb
Created December 17, 2008 16:24 — forked from mrb/snippet.rb
module ActionView
module Helpers
class InstanceTag
def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
options = options.stringify_keys
options["type"] = "checkbox"
options["value"] = checked_value
if options.has_key?("checked")
cv = options.delete "checked"
checked = cv == true || cv == "checked"
@quirkey
quirkey / gist:16142
Created October 10, 2008 19:47 — forked from mrb/gist:16141
TherapistReport.send(:with_exclusive_scope) {
@last_tr = TherapistReport.find(:all, :conditions => ["report_id = ? AND therapist_id = ? AND report.territory_id = ? ", self.report.previous, self.therapist_id, self.report.territory_id], :include => [:report])
}
@quirkey
quirkey / gist:1247
Created July 22, 2008 20:02 — forked from mrb/gist:1245
module ApplicationHelper
def e_tag(model)
eval("link_to image_tag(\'pencil.png\'), edit_#{model.class.name.underscore}_path(model)")
end
def d_tag(model)
eval("link_to image_tag(\'delete.png\'), model, :confirm => \'Are you sure?\', :method => :delete")
end