Skip to content

Instantly share code, notes, and snippets.

@gus
gus / Rakefile
Created July 19, 2010 18:40
rackme
require 'rubygems'
require 'rake'
require 'pathname'
module ThumbleMonks
class Tastic # Formerly Rake::Static
def initialize(app, options={})
@app = app

Create an account on github.com (skip if you already have one)

Create a repo on github.com: using s-and-m for this example

Locally, run the following commands:

git svn clone -s svn://hostname/s-and-m
git clone ./s-and-m better-s-and-m
cd better-s-and-m

git remote rm origin

@gus
gus / ruby-coding-style.md
Created July 8, 2010 14:16
Coding in Ruby - mostly the Gus way

Hijacked from Christian Neukirchen's Ruby Style Guide

Coding in Ruby

These are guides, not rules. There are always reasons to not do something, but if you can stay on this road for as long as possible, at least Gus will be happy.

General

  • Use common sense.
  • Be consistent.
@gus
gus / interpreter.ml
Created November 10, 2009 20:15
OCaml Interpreter
type exp =
IntExp of int
| Builtin of (exp -> env -> exp)
| VarExp of string
| FunExp of string * exp
| LetExp of string * exp * exp
| IfExp of exp * exp * exp
| AppExp of exp * exp
and
env = (string * exp) list
@gus
gus / gist:180907
Created September 4, 2009 14:24 — forked from mtodd/gist:180398
Ruby and Heredocs
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH
Quotes also give you more freedom/creativity with the terminal ID:
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
hQIMA5qBTfxp70ruARAAlw6neEZ62CHefe6NhllFcGZ98I6vCOAkbtXTdOmocM4y
KfhocqhNjL9rWf35TEq1iP1kwXvz9mnAoWd8ZMftIOYf+2Hg7hbuxl+9MgUknxz7
NkPwF4hIvebqIjylDQTvO8/ry+rAzmdYQWgNsnxomAUVOAzYBuDr8xfGkOvYRvdI
wAtGSViQ4eeZHLDZ0IGH2ptzHt/Wr5/6teDOBmb6D8yyS4MEJP0o/qhAvDXUWEMH
jCRyb/s3hXo0eXvG3Zczkvd2yrjqyo0t8sqi/lOV6yHarT5btzHpPMczyD/q6Leb
7ecaumtwlIY5Ysyirri2vJ1YRfMkhZNqvpM7aO6ANnW6WaP1xD3YlX+PQm0cAtYp
vKEr1E8IjmGxfHhx3tv2AAsvHL4kUFmQ7vCxRGXTKwN8M8OZGJ4rnfMt/wA+gHy+