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
# 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
#!/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
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
#!/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
#!/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
=begin | |
Shooter | |
<http://gist.github.com/25886> | |
Harry Vangberg <http://trueaffection.net> | |
Simon Rozet <http://purl.org/net/sr/> | |
EXAMPLE | |
IRC.shoot('irc://irc.freenode.net:6667/integrity', :as => "IntegrityBot") do |channel| |
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
The list is now managed directly in Sinatra's website. | |
<http://www.sinatrarb.com/wild.html> |
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 'grit' | |
%w(saloon config couchy dst dumbapp git-wiki integrity).each do |repository| | |
repo = Grit::Repo.new(File.expand_path("~/code/#{repository}")) | |
commits = repo.log.collect { |commit| commit.message } | |
total_commits = commits.length.to_f | |
cosmetic_commits = commits.select { |message| message =~ /cosmetic/ }.length.to_f | |