Public Gists by geetarista

Gravatar
Tue Oct 13 09:26:57 -0700 2009
1
2
3
# Taken from: http://www.pauldix.net/2009/10/using-the-nginx-memcached-module-with-passenger.html
 
user nobody nogroup;
Gravatar
Tue Oct 13 09:24:13 -0700 2009

      
Gravatar
Fri Sep 04 11:06:04 -0700 2009
1
2
3
function daylog() {
  git log --format="%s " --since="18 hours ago" --author="Your Name" --no-merges --reverse | xargs ruby -e "puts ARGV.join(' ')"
}
Gravatar
Tue Jul 14 13:20:41 -0700 2009
1
2
3
(function($) {
  // errors is an array of errors
  // render :json => {:errors => @item.errors.full_messages}
Gravatar
Tue May 19 16:49:38 -0700 2009
1
2
3
# Cache Headers
# Middleware for configuring HTTP cache policy headers in Rack based web applications.
# Apply cache headers to HTTP responses corresponding to requests that match defined
Gravatar
Fri May 15 15:25:35 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'rubygems'
gem 'rack', '=0.9.1'
Gravatar
Tue Apr 28 13:00:15 -0700 2009
1
2
3
# Run use this template by running: rails my_new_app -m /path/to/template.rb (can also be an URL)
# Or, to use on an existing project: rake rails:template LOCATION=~/template.rb
 
Gravatar
Tue Apr 21 20:13:04 -0700 2009
1
2
3
#!/bin/bash
 
if [ "$(whoami)" != "root" ]; then
Gravatar
Mon Apr 13 13:55:02 -0700 2009
1
2
3
#!/usr/bin/env macruby
#
# DarkRoom
Gravatar
Mon Apr 13 09:29:29 -0700 2009
1
2
3
require 'iconv'
 
module ActiveSupport
Gravatar
Mon Mar 30 13:19:51 -0700 2009
1
2
3
task :export do
require 'sequel'
require 'fastercsv'
Gravatar
Thu Mar 19 13:30:48 -0700 2009
1
2
3
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
Rspactor::Runner.class_eval do
Gravatar
Sat Mar 07 15:06:22 -0800 2009
1
2
3
# comes with:
# * working user registration/login via authlogic
# * rspec/cucumber/culerity for testing
Gravatar
Wed Mar 04 08:13:18 -0800 2009
1
2
3
// jQuery checkbox utility plugin.
// By Henrik Nyh <http://henrik.nyh.se> 2009-02-27 under the MIT License.
 
Gravatar
Mon Mar 02 13:41:28 -0800 2009

      
Gravatar
Wed Feb 25 15:32:30 -0800 2009
1
2
3
#!/usr/bin/env ruby
#
# usage: script/server_restarter
Gravatar
Thu Feb 12 09:18:41 -0800 2009
1
2
3
if rails_env = ENV['RAILS_ENV']
  rails_root = File.basename(Dir.pwd)
 
Gravatar
Thu Feb 12 09:04:04 -0800 2009
1
2
3
class Announcement < ActiveRecord::Base
 
  named_scope :active, lambda { { :conditions => ['starts_at <= ? AND ends_at >= ?', Time.now.utc, Time.now.utc] } }
Gravatar
Mon Feb 09 16:14:16 -0800 2009
1
2
3
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
Gravatar
Fri Feb 06 08:28:44 -0800 2009
1
2
3
# Example of how to test a module included into multiple models
 
require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper"))