View heroku-gemfile.rb
1 2 3 4 5 6 7 8 9 10
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}"
return
end
puts "#{n} -v#{v}#{$src ? " -s#{$src}": ""}"
end
load ARGV[0] || "Gemfile"
View todo
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
# 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
1 2 3 4 5 6 7 8 9 10
require "rack/client"
require "rack/cache"
require "rack/test"
 
app = Rack::Builder.new {
use Rack::Cache,
:verbose => true,
:metastore => "heap:/",
:entitystore => "heap:/"
run Rack::Client
View dwm-bar.io
1 2 3 4 5 6 7 8 9 10
#!/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)
1 2 3 4 5 6 7 8 9 10
#!/bin/awk -f
 
# md2html.awk
# by: Jesus Galan (yiyus) <yiyu.jgl@gmail>, May 2009
# Usage:
# md2html file.md > file.html
# Options: -v esc=false to not escape html
 
function newblock(nblock){
if(text)
View gist:108184
1 2 3 4 5 6 7 8 9 10
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
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
require "rubygems"
require "integrity"
 
class Refresher
JS = <<-EOS
<script type="text/javascript">
//<![CDATA[
setTimeout('location.reload()', %s * 1000)
//]]>
View test.rb
1 2 3 4 5 6 7 8 9 10
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
1 2 3 4 5 6 7 8 9
#!/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
View gist:66980
1 2 3 4 5 6 7 8 9 10
/* 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";
Something went wrong with that request. Please try again.