This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Meh, I went overboard. Usage: | |
# | |
# To tweet, write in channel: | |
# nancie, tweet this: some nice thing about sinatra and stuff | |
# To give permissions, private message: | |
# /msg nancie allow awesome_user | |
# | |
# Additional extensions are welcome. | |
require 'rubygems' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- ruby -*- | |
# twitter command line client | |
# That's What I Call Lame | |
# 09nov2008 +chris+ | |
require 'json' | |
require 'open-uri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo < Sinatra::Base | |
host_name "sinatrarb.com" | |
user_agent /Mosaic/ | |
provides :xml | |
get '/' do | |
"Welcome!" | |
end | |
get '/' do | |
"You are not to be welcomed!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Rack::Auth::Basic do |username,password| | |
password == 'secret' | |
end | |
get '/' do | |
"welcome in the secret zone" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 4039b792c6af983552705302c282bd35b59ea9e4 | |
Author: Simon Rozet <simon@rozet.name> | |
Date: Wed Jan 28 23:57:51 2009 +0100 | |
Back to the essences | |
* Back to Markdown | |
* I suck at CSS, and I'd rather provide no CSS | |
than one that sucks. | |
* All that JS floating around is just unecessary bloat to me. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* See LICENSE file for copyright and license details. */ | |
/* appearance */ | |
static const char font[] = "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*"; | |
static const char normbordercolor[] = "#cccccc"; | |
static const char normbgcolor[] = "#cccccc"; | |
static const char normfgcolor[] = "#000000"; | |
static const char selbordercolor[] = "#0066ff"; | |
static const char selbgcolor[] = "#0066ff"; | |
static const char selfgcolor[] = "#ffffff"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat <<EOF | |
<entry> | |
<title>Omnifaria $1</title> | |
<published>$(date --utc)</published> | |
<updated>$(date --utc)</updated> | |
<content type="xhtml"><div>$(cat | ./src/markdown)</div></content> | |
</entry> | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
module Test | |
module Session | |
attr_reader :last_response | |
attr_reader :last_request | |
alias_method :response, :last_response | |
alias_method :request, :last_request | |
def initialize(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "rubygems" | |
require "integrity" | |
class Refresher | |
JS = <<-EOS | |
<script type="text/javascript"> | |
//<![CDATA[ | |
setTimeout('location.reload()', %s * 1000) | |
//]]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test/unit" | |
require "rack/test" | |
require "contest" | |
require "sinatra/base" | |
class MyApp < Sinatra::Base | |
set :environment, :test | |
get "/" do | |
"Hi, #{params["name"]}." |