Public Gists by fmiopensource

Gravatar
Wed Nov 11 08:56:49 -0800 2009
1
2
3
def putsc(text, color='y')
  code = case color
  when 'y' then 33
Gravatar
Mon Oct 05 08:27:21 -0700 2009
1
2
3
# add value from param to task if:
# - its in the list
# - its in the params so sending nil will nil it but sending nothing will leave it alone
Gravatar
Tue Aug 11 08:34:54 -0700 2009
1
2
3
# This method is heavily adapted from the Rails method of determining the subdomain.
require 'rubygems'
require 'sinatra'
Gravatar
Fri Jul 31 12:57:44 -0700 2009
1
2
3
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
 
Gravatar
Mon Jul 20 10:14:47 -0700 2009
1
2
3
$(document).ready(function() {
  $('.delete').click(function() {
    if(confirm('Are you sure?')) {
Gravatar
Thu Feb 05 12:39:23 -0800 2009
1
2
3
/*
 
To make this trick work, I embed the time stamp for a given entry in the DOM as a custom attribute that I can query for conversion like this: