Public Gists by CodeOfficer

Gravatar
Sun Oct 25 13:57:16 -0700 2009
1
2
3
require 'nokogiri'
require 'open-uri'
require 'stringex'
Gravatar
Sat Oct 17 19:12:09 -0700 2009
1
2
3
  def IRB.run_config
    if @CONF[:RC]
      begin
Gravatar
Thu Sep 24 20:30:07 -0700 2009
1
2
3
Exception
 NoMemoryError
 ScriptError
Gravatar
Sun Sep 06 15:18:07 -0700 2009
1
2
3
# install ruby-mysql for snow leopard
 
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-configusr/local/mysql/bin/mysql_config
Gravatar
Sun Sep 06 00:10:26 -0700 2009
1
2
3
mysql: &mysql
  adapter: mysql
  username: root
Gravatar
Mon Aug 24 18:22:35 -0700 2009
1
2
3
class JobsController < ApplicationController
 
  before_filter :require_user, :except => [ :index, :show ]
Gravatar
Mon Aug 17 15:53:19 -0700 2009
1
2
3
(function(message){
  alert(message);
})('hello!');
Gravatar
Sun Aug 16 19:55:47 -0700 2009
1
2
3
module AccordionsHelper
  
  def accordions_for( *options, &block )
Gravatar
Thu Jul 30 02:06:39 -0700 2009
1
2
3
/*
 * a smart poller for jquery.
 * (by github)
Gravatar
Sun Jul 26 00:32:28 -0700 2009
1
2
3
# adapted from http://blog.caboo.se/articles/2006/12/28/a-better-capistrano-backup
# supports multistage deploy setup
# allows for restore and local database imports
Gravatar
Sat Jul 11 19:24:12 -0700 2009
1
2
3
jQuery.fn.restForm = function(type, options) {
  var defaults = {
    method: 'post',
gist: 142406 sorting like mac's finder
Gravatar
Tue Jul 07 15:07:15 -0700 2009
1
2
3
# Mimic Mac OS X Finder's sort by name.
class Array
  def finder_sort
Gravatar
Fri Jun 26 13:16:04 -0700 2009
1
2
3
  $('button[type="submit"]').bind('click', function() {
    this.setAttribute('originalValue', this.innerHTML);
    this.disabled=true;
Gravatar
Thu Jun 11 11:06:46 -0700 2009
1
2
3
require 'tempfile'
 
def say(cmd, voice='Fred')
Gravatar
Mon Mar 02 21:45:06 -0800 2009
1
2
3
# another great snippet courtesy of http://heypanda.com/
 
class Fixnum
Gravatar
Sun Mar 01 18:57:05 -0800 2009
1
2
3
# courtesy of http://heypanda.com/
 
class TryProxy
Gravatar
Sun Mar 01 18:20:22 -0800 2009
1
2
3
                                           posts GET /posts {:controller=>"posts", :action=>"index"}
                                 formatted_posts GET /posts.:format {:controller=>"posts", :action=>"index"}
                                                 POST /posts {:controller=>"posts", :action=>"create"}
Gravatar
Sat Feb 28 20:05:24 -0800 2009
1
2
3
/*
  NAME: Russell Jones
  DATE: February 21, 2007
Gravatar
Sat Feb 28 15:28:05 -0800 2009
1
2
3
alias home='cd ~/'
alias ll='ls -lAGhF'
alias tld='tail -f log/development.log'
Gravatar
Sat Feb 28 14:49:00 -0800 2009
1
2
3
require '../lib/liquid'
 
class User