Skip to content

Instantly share code, notes, and snippets.

View tbuehlmann's full-sized avatar

Tobias Bühlmann tbuehlmann

View GitHub Profile
@tbuehlmann
tbuehlmann / README
Created October 11, 2010 14:15
Installing Ruby 1.9.2-p0 on Ubuntu 10.10 (ubuntu-10.10-desktop-amd64)
$ sudo apt-get install build-essential zlib1g zlib1g-dev libruby1.9.1 libxml2 libxml2-dev libxslt1-dev
$ sudo apt-get build-dep ruby1.9.1
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
$ tar xvjf ruby-1.9.2-p0.tar.bz2
Open ruby-1.9.2-p0/ext/Setup and uncomment the zlib line
$ ./configure
$ make
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'foo'
run Foo
- nav.each do |item|
- item.each do |name, href|
%li{:href => href}= name
require 'ponder'
# simulating a very simple queue
@queue = []
Thread.new do
loop do
@queue << rand(10000).to_s
sleep 5
end
end
resources :users do
# /users/:id/confirm_email(.:format)
# confirm_mail_user_path
get :confirm_email, :on => :member
end
= link_to(posts_path) do
%u foo
%i bar
%b baz
#friend_list
#scrolling_list
- (1..5).each do |i|
.friend_summary
%img{:src => "images/friend-default.png"}
%foo>
%br
%bar
@tbuehlmann
tbuehlmann / application.rb
Created February 28, 2011 15:01
application.rb
require 'haml'
require 'sinatra/base'
class Application < Sinatra::Base
configure do
enable :static
set :views, File.join(File.dirname(__FILE__), 'views')
set :public, File.join(File.dirname(__FILE__), 'public')
end
- cars.each_with_index do |car, index|
%p{:class => car, :id => "car_#{index + 1}"}