View heroku-gemfile.rb
def disable_rubygems; nil; end
def source(s); $src = s unless s[/gemcutter/] end
def gem(n, v)
if Hash === v
$stderr.puts "ignoring git gem #{n}"
puts "#{n} -v#{v}#{$src ? " -s#{$src}": ""}"
load ARGV[0] || "Gemfile"
View todo
# Best To-Do List. Ever.
# Usage:
# 1. Add a new item to list: `todo This needs to be fixed`
# 2. Edit the to-do list: `todo -e`
# 3. Show the current to-do's: `todo`
if [[ $1 ]]; then
if [ $1 = "-e" ]; then
View gist:151557
require "rack/client"
require "rack/cache"
require "rack/test"
app = {
use Rack::Cache,
:verbose => true,
:metastore => "heap:/",
:entitystore => "heap:/"
run Rack::Client
#!/usr/bin/env io
date := Date now asString("%Y-%m-%d %H:%M:%S")
wifi := File clone openForReading("/proc/net/wireless") readLines \
at(2) split at(5) removeAt(2) asString
mpd := method(
File clone openForReading("/home/simon/.mpd/state") foreachLine(i, line,
parts := line split(":")
if(parts at(0) == "state", state := parts at(1))
View Markdown in awk(1)
#!/bin/awk -f
# md2html.awk
# by: Jesus Galan (yiyus) <yiyu.jgl@gmail>, May 2009
# Usage:
# md2html > file.html
# Options: -v esc=false to not escape html
function newblock(nblock){
View gist:108184
require "test/unit"
require "rack/test"
require "contest"
require "sinatra/base"
class MyApp < Sinatra::Base
set :environment, :test
get "/" do
"Hi, #{params["name"]}."
View gist:91275
#!/usr/bin/env ruby
require "rubygems"
require "integrity"
class Refresher
JS = <<-EOS
<script type="text/javascript">
setTimeout('location.reload()', %s * 1000)
View test.rb
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)
View atomize
#!/usr/bin/env bash
cat <<EOF
<title>Omnifaria $1</title>
<published>$(date --utc)</published>
<updated>$(date --utc)</updated>
<content type="xhtml"><div>$(cat | ./src/markdown)</div></content>
View gist:66980
/* 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";