Skip to content

Instantly share code, notes, and snippets.

ActionController::Routing.use_controllers! ["static"]
load "config/routes.rb"
test "should route /riff/some-title" do
assert_routing('/riff/some-foo-bar',
:controller => 'static', :action => 'show_riff', :title => 'some-foo-bar')
end
test "should route /static/new_riff" do
assert_routing('/riffs',
./mytwitter
./mytwitter/public
./mytwitter/public/views
get '/' do
erb :form
end
post '/list_twits' do
twit = Twitter::Search.new
tiwts = twit.from(params[:login])
@twits = []
tiwts.each do |t|
@twits << t.text
end
erb :list
end
<form name="twitter_form" action="/list_twits" method="post">
Twitter login:<br/><br/>
<input type="text" id="login" name="login" /><br/><br/>
<input type="submit" value="Get twits!"/>
</form>
<ul>
<% @twits.each do |t| %>
<li><%= t %></li>
<% end %>
</ul>
require 'rubygems'
Gem.clear_paths
require 'twitter'
require 'sinatra'
Sinatra::Application.default_options.merge!(
:run => false,
:env => :production,
:views => 'public/views'
@caike
caike / gist:63034
Created February 13, 2009 03:45
spring beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="mailman" class="com.school.domain.Mailman" />
<!-- <bean id="email" class="com.school.domain.Email" />-->
<bean id="school" class="com.school.domain.School">
The best early Maiden songs were about
1.whores
2.killing whores
3.being wrongly accused of killing whores
4.being on the run after killing whores
5.being on the run after being wrongly accused of killing whores
6.being led to the gallows(probably for killing whores but this is unconfirmed)
7.Walking around with your junk hanging out.
<!--
ATENÇÃO: os links estão ordenados alfabeticamente. Siga esta nomenclatura ao adicionar o seu.
-->
<h2>#horaextra</h2>
<ul id="blogroll">
<li><a href="http://caikesouza.com/?utm_campaign=horaextra">Caike Souza</a></li>
<li><a href="http://tapajos.me/?utm_campaign=horaextra">Marcos Tapajós</a></li>
<li><a href="http://rafael.adm.br/?utm_campaign=horaextra">Rafael Lima</a></li>
<li><a href="http://rafael.tauil.com.br/?utm_campaign=horaextra">Rafael Tauil</a></li>
<li><a href="http://ramonpage.com/?utm_campaign=horaextra">Ramon Bispo</a></li>