Public Gists by rtomayko

Gravatar
Fri May 15 16:59:23 -0700 2009
1
2
3
16:47 Topic: Sinatra | http://sinatra.github.com/ | git: http://github.com/sinatra/sinatra | faq: http://sinatra.github.com/faq.html | 0.9.1 released - http://groups.google.com/group/sinatrarb/browse_thread/thread/7601c16ad7960cdd
16:47 Mode: +sn
16:53 alexch has joined (n=alexch@c-67-188-110-65.hsd1.ca.comcast.net)
Gravatar
Thu Apr 30 11:23:27 -0700 2009
1
2
3
require 'sinatra'
 
get '/' do
Gravatar
Thu Apr 16 14:16:21 -0700 2009
1
2
3
class CachePolicy < Sinatra::Base
 
  # always forward the request downstream immediately (before processing routes)
Gravatar
Mon Mar 30 16:47:53 -0700 2009
1
2
3
class StringizingBody
  def initialize(body)
    @body = body
Gravatar
Sat Mar 14 18:02:10 -0700 2009
1
2
3
# Rack::Buffer - buffers response bodies into fixed sized frames for better
# performance under servers that write each chunk to the client as it's produced
# by body.each (e.g., Mongrel, Thin with fibers).
Gravatar
Fri Mar 13 14:37:45 -0700 2009
1
2
3
# http://groups.google.com/group/sinatrarb/browse_thread/thread/84d525759af8615a
require 'fileutils'
 
gist: 78554 Thin: iterative/concurrent ...
Gravatar
Fri Mar 13 05:54:35 -0700 2009
1
2
3
# This is a tiny rack app that demonstrates iterative/concurrent response processing
# in Thin using the following fiber patch:
#
gist: 75745 MacPorts GC
Gravatar
Sun Mar 08 05:00:57 -0700 2009
1
2
3
$ sudo su -
# du -sh /opt
6.4G /opt
gist: 74683 My Multiple Ruby Setup
Gravatar
Thu Mar 05 17:12:50 -0800 2009
1
2
3
# This isn't as elegant as some of the other solutions for running multiple versions
# of Ruby but it's simple, straight-forward and has worked well for me so far. I'm
# currently running the most recent stable versions of 1.8.5, 1.8.6, 1.8.7, and
Gravatar
Wed Mar 04 08:18:44 -0800 2009
1
2
3
require 'rack/utils'
 
module Rack
Gravatar
Fri Feb 27 22:48:58 -0800 2009
1
2
3
#!/bin/sh
# Usage: git-thanks <since>..<until>
#
Gravatar
Thu Feb 26 02:16:26 -0800 2009
1
2
3
# first: mkdir ~/.ssh/cache
# then put the following somewhere in your ~/.ssh/config:
Host *
gist: 70323 Sinatra: Iterative/streamed...
Gravatar
Wed Feb 25 10:11:00 -0800 2009
1
2
3
require 'sinatra'
 
class DatabaseStreamer
Gravatar
Sun Feb 22 01:32:27 -0800 2009
1
2
3
The "registered" module method was added to help ensure that extensions can
initialize options in a way that guarantees they can be accessed using
"options.option_name" at the request-level or "self.option_name" at the class
Gravatar
Fri Feb 20 06:37:53 -0800 2009
1
2
3
hardstatus alwayslastline "%{=b}%{G} : %{b}%w %=%{kG}%C%A"
 
# -------------------------------------------------------------------
Gravatar
Thu Feb 05 22:55:50 -0800 2009
1
2
3
$ ab -n 10000 -c 150 -k http://localhost:3000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Gravatar
Tue Feb 03 19:58:51 -0800 2009
1
2
3
require 'sinatra'
require 'compass'
require 'ostruct'
Gravatar
Mon Feb 02 13:57:24 -0800 2009
1
2
3
HOWTO Run Rack's fulltest Suite on MacOS (with rubygems)
========================================================
 
Gravatar
Fri Jan 30 06:03:51 -0800 2009
1
2
3
# BAD:
foo.bar = 25
foo.biz = 'Hello World'
Gravatar
Thu Jan 29 17:56:02 -0800 2009
1
2
3
class Foo < Sinatra::Base
  host_name "sinatrarb.com"
  user_agent /Mosaic/