This file contains hidden or 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 | |
def truncate(text, length = 30, truncate_string = "...") | |
if text.nil? then return end | |
l = length - truncate_string.length | |
(text.length > length ? text[0..l] + truncate_string : text).to_s | |
end | |
def date | |
Time.now.strftime('%Y/%m/%d %H:%M') | |
end |
This file contains hidden or 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 | |
base = File.dirname(__FILE__) + "/../code/git-wiki" | |
require base + '/git-wiki' | |
set :public, base + '/public' | |
set :port, 4567 | |
set :env, :production | |
disable :run, :reload | |
This file contains hidden or 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
get '/:id' do | |
@vent = Vent.get(params[:id]) | |
erb :show | |
end | |
# show post | |
get '/:id.xml' do | |
@vent = Vent.get(params[:id]) | |
builder :show | |
end |
This file contains hidden or 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
#!/bin/bash | |
cat <<EOF | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>Notes en Vrac</title> | |
<link rel="alternate" type="application/atom+xml" | |
title="Notes en Vrac (Atom)" href="/notes/feed" /> | |
<style type="text/css"> | |
@import "/2008/10-crumb.css"; |
This file contains hidden or 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
# WTFPL | |
# Requires http://github.com/rtomayko/sinatra/tree/hoboken | |
require "rubygems" | |
require "rack" | |
require "thin" | |
require "pathname" | |
require "addressable/uri" | |
require "sinatra/base" | |
This file contains hidden or 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 "rubygems" | |
require "rack" | |
$:.unshift File.dirname(__FILE__) + "/lib" | |
require "sinatra/base" | |
class Sinatra::Application | |
get "/" do | |
"Hello World" | |
end | |
end |
This file contains hidden or 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
Sinatra Pimping | |
=============== | |
Ideas/Brain dump | |
---------------- | |
* Do not show the README on the front page. But: | |
* Elevator pitch | |
* Code | |
* Mailing-List, #sinatra, Bug tracker |
This file contains hidden or 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
# A Sinatra App as a Rails Plugin | |
# | |
# In your Edge Rails app: | |
# | |
# ruby script/plugin install git://gist.github.com/50625.git | |
require 'sinatra/base' | |
class SinatraRailsPlugin < Sinatra::Base | |
This file contains hidden or 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
✈ |
This file contains hidden or 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 7f15f6447d38cab55b46ae3210db773e1f61af4a | |
Author: Simon Rozet <[email protected]> | |
Date: Wed Jan 28 17:31:07 2009 +0100 | |
last one | |
diff --git a/index.html b/index.html | |
index 4b10db2..0b09989 100644 | |
--- a/index.html | |
+++ b/index.html |