Public Gists by rares

Gravatar
Tue Aug 25 05:22:13 -0700 2009
1
2
3
class Object
  def send_through(object, *args)
    object.dispatcher_for(self).call(self, *args)
Gravatar
Fri Aug 21 12:07:02 -0700 2009
1
2
3
# put this in ~/.bash_profile or whatever
ruby_or_irb () {
  if [ "$1" == "" ]; then
Gravatar
Thu Jul 30 10:27:29 -0700 2009
1
2
3
/*
 * a smart poller for jquery.
 * (by github)
Gravatar
Thu Jul 16 12:44:48 -0700 2009
1
2
3
start_dir=`pwd`
for dir in `find . -type d | grep -v .svn | sort -r`; do
cd $dir
Gravatar
Fri Apr 24 15:46:35 -0700 2009
1
2
3
package com.robares.wp.scala.collections
 
/**
Gravatar
Sun Apr 05 20:23:52 -0700 2009
1
2
3
class FilterableEnumerable
  def initialize(original)
    @original = original
Gravatar
Wed Mar 18 10:40:28 -0700 2009
1
2
3
require 'rubygems'
require 'redis'
require 'rfeedparser'
Gravatar
Wed Mar 18 05:05:13 -0700 2009
1
2
3
In response to all the responses to:
 
http://twitter.com/rtomayko/status/1155906157
Gravatar
Thu Mar 05 16:08:41 -0800 2009
1
2
3
// This is a super simple utility function that I've found very powerful
// when compared to the vanilla binding pattern.
 
Gravatar
Mon Mar 02 19:04:17 -0800 2009
1
2
3
#!/usr/bin/env ruby
 
# The script that give you focus!
Gravatar
Sat Feb 28 04:39:12 -0800 2009
1
2
3
#!/bin/sh
# Usage: git-thanks <since>..<until>
#
Gravatar
Tue Feb 24 16:45:45 -0800 2009
1
2
3
task :clean do
  important_cleans = `git clean -n -d`.split("\n")
  important_cleans.reject! { |file|
Gravatar
Fri Feb 20 22:27:02 -0800 2009
1
2
# deploy to staging from your current topic branch, with ease
set :branch, "origin/#{`git name-rev --name-only head`}"
Gravatar
Mon Feb 09 08:43:06 -0800 2009
1
2
3
    desc "Do rolling restarts of the Mongrel servers in pairs, at 90s intervals."
    task :rolling do
      servers = []
Gravatar
Fri Jan 16 16:57:39 -0800 2009
1
2
3
# at the very least, use inheritance!
 
class Object
Gravatar
Wed Jan 07 12:56:25 -0800 2009
1
2
3
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
Gravatar
Fri Dec 19 13:03:38 -0800 2008
1
2
3
# Lessons Learned
 
## Be Confident
Gravatar
Tue Nov 18 10:52:49 -0800 2008
1
2
3
rails_root = "/data/github/current"
 
20.times do |num|
Gravatar
Sat Nov 15 22:01:23 -0800 2008
1
2
3
$:.unshift File.dirname(__FILE__) + "/lib"
require "oauth/consumer"
require "pp"
Gravatar
Wed Nov 12 15:46:16 -0800 2008
1
2
3
require 'rubygems'
require 'xmpp4r-simple'
require 'pp'