Skip to content

Instantly share code, notes, and snippets.

View bmizerany's full-sized avatar
💭
Working on something new

Blake Mizerany bmizerany

💭
Working on something new
View GitHub Profile
## Pseudo auto-respond-to in Sinatra.
module Sinatra
module AutoRespondTo
def self.registered(app)
app.after do
case request.accept.first
when "application/json"
body { body.to_json }
when "application/xml"
@bmizerany
bmizerany / Gemfile
Created February 18, 2010 07:54 — forked from d--j/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem 'sinatra'
group :development do
# bundler requires these gems in development
gem 'rails-footnotes'
end
group :test do
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ ./configure --prefix=/usr/local/lib/ruby/gems/1.8/gems/gdb.rb-0.1.1/ext/dst/
## --------- ##
## Platform. ##
have_header: checking for python2.5/Python.h... -------------------- yes
"gcc -E -I. -I/usr/local/lib/ruby/1.8/x86_64-linux -I. -g -Os -fno-strict-aliasing conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <python2.5/Python.h>
/* end */
--------------------
screen -X "split"
screen -X "focus"
screen -X "screen"
screen -X exec ! $@

recho is Officially here

require 'sinatra-jruby-glassfish'
# You would only say MyApp.run! is
# how you run Sinatra::Base apps
# when there is no rackup file
# Use this in a rackup file
run MyApp
rack_hoptoad
#!/usr/bin/env macruby
framework 'Cocoa'
## I want something like this to work.
char *p = "testing"
## along side of this
10.times { puts p }
require 'sinatra'
get '/example-view' do
@name = "testing"
erb(:example_view)
end