Public Gists by timriley

Gravatar
Wed Feb 25 18:18:21 -0800 2009
1
2
3
require 'singleton'
 
class String
Gravatar
Tue Feb 24 13:42:39 -0800 2009
1
2
3
# 1. Create dirs for unpacking your source code and installing your apps
mkdir $HOME/src
mkdir $HOME/apps
Gravatar
Sun Feb 15 02:00:58 -0800 2009
1
2
3
gem 'chriseppstein-compass', '~> 0.4'
require 'compass'
 
Gravatar
Thu Feb 12 13:37:11 -0800 2009
1
2
3
%table.tickets{:cellpadding => 0, :cellspacing => 0}
  %thead
    %tr
Gravatar
Thu Feb 12 13:34:28 -0800 2009
1
2
3
helpers do
  def cycle
    @_cycle ||= reset_cycle
Gravatar
Sun Feb 08 00:49:08 -0800 2009
1
2
3
!!! Strict
%html{:xmlns =>'http://www.w3.org/1999/xhtml', 'xml:lang' => 'en', :lang => 'en'}
  %head
Gravatar
Sun Feb 08 00:48:24 -0800 2009
1
2
3
helpers do
  def versioned_stylesheet(stylesheet)
    "/stylesheets/#{stylesheet}.css?" + File.mtime(File.join(Sinatra::Application.views, "stylesheets", "#{stylesheet}.sass")).to_i.to_s
Gravatar
Sun Feb 08 00:47:34 -0800 2009
1
2
3
get "/stylesheets/screen.css" do
  content_type 'text/css'
  response['Expires'] = (Time.now + 60*60*24*356*3).httpdate
Gravatar
Sun Feb 08 00:46:08 -0800 2009
1
2
3
get "/stylesheets/screen.css" do
  content_type 'text/css'
  sass :"stylesheets/screen"
Gravatar
Thu Feb 05 20:08:19 -0800 2009
1
2
3
# in haml
-col_table(:class => 'paycycle') do
  / make a column for each date
Gravatar
Tue Jan 27 02:53:29 -0800 2009
1
2
3
def sass(template, options={}, &block)
  require 'sass' unless defined? ::Sass
  options[:layout] = false
Gravatar
Tue Jan 27 02:36:55 -0800 2009
1
2
3
get "/stylesheets/screen.css" do
  content_type 'text/css'
 
Gravatar
Tue Jan 13 02:39:58 -0800 2009
1
2
3
require "rubygems"
require "rbench"
 
Gravatar
Thu Jan 08 14:27:32 -0800 2009
1
2
3
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer: