Skip to content

Instantly share code, notes, and snippets.

View dstrelau's full-sized avatar

Dean Strelau dstrelau

View GitHub Profile
@corey
corey / index.txt
Created September 19, 2009 01:12 — forked from mmcgrana/index.txt
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@defunkt
defunkt / carbon.md
Created November 5, 2009 20:45
Reduce your carbon footprint

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

@dstrelau
dstrelau / README
Created July 20, 2010 01:54
Delegation with send(m,*a) { yield }
== DELEGATING WITH method_missing ==
= This works:
send(method, *args, &block)
...but it can use lots of memory: see http://blog.pluron.com/2008/02/rails-faster-as.html
= This works:
@mattcg
mattcg / flashpolicy.xml
Created July 25, 2010 20:05
A simple Flash socket policy server for NodeJS.
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<!-- Policy file for xmlsocket://socks.example.com -->
<cross-domain-policy>
<!-- This is a master socket policy file -->
<!-- No other socket policies on the host will be permitted -->
<site-control permitted-cross-domain-policies="master-only"/>
-module(flashpolicy).
-vsn("0.9.01").
-export([ start/0, stop/0 ]).
-export([ init/3 ]).
-export([ wait/2 ]).
-define(POLICY_FILE, "/path/to/policyfile.xml").
start() ->
start(?POLICY_FILE, 843, 3 ).
@dstrelau
dstrelau / app.rb
Created November 22, 2010 20:36
Gollum protected by HTTP Basic
require 'gollum/frontend/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash)
before { authenticate! }
helpers do
def authenticate!
@DavidYKay
DavidYKay / gist:912765
Created April 10, 2011 21:52
"Can Code Be Like Literature" - Jeremy Ashkenas
Jeremy
Absolutely brilliant
both technically
and oratorically
He wrote CoffeeScript
1st place 5k
21 min, 3 seconds
<7min mile
Big picture
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@dstrelau
dstrelau / caveatPatchor.js
Created June 23, 2011 15:14 — forked from protocool/caveatPatchor.js
caveatPatchor.js file for use in Propane
var displayAvatars = true;
var displayCloudAppImages = true;
var displayGists = true;
if (displayAvatars) {
Object.extend(Campfire.Message.prototype, {
addAvatar: function() {
if (this.actsLikeTextMessage()) {
var author = this.authorElement();
@jamis
jamis / cap-transcriber.rb
Created July 25, 2011 14:57
Capistrano Transcriber: a wrapper script for Capistrano that writes session transcripts to a timestamped file.
#!/usr/bin/env ruby
require 'capistrano/cli'
class TranscriptLogger
module TranscriptLoggerMetadata
attr_accessor :tx_logger_metadata
def self.apply_to(object, options={})
object.extend(self) unless object.respond_to?(:tx_logger_metadata)