Public Gists by jnewland

Gravatar
Sun Oct 18 07:39:38 -0700 2009
1
2
3
# Package Maintainer: Increment phusion_release to match latest release available
%define phusion_release 20090928
 
Gravatar
Fri Oct 09 07:36:39 -0700 2009

      
Gravatar
Wed Sep 16 06:58:08 -0700 2009
1
2
3
after "deploy:setup", "thinking_sphinx:shared_sphinx_folder"
after 'deploy:finalize_update', 'thinking_sphinx:symlink_indexes'
after 'deploy:restart', 'thinking_sphinx:restart'
Gravatar
Thu Sep 03 19:27:02 -0700 2009
1
2
3
task :ssh do
  exec "ssh #{user}@#{roles[:app].servers.first}"
end
Gravatar
Thu Sep 03 15:16:13 -0700 2009
1
2
3
Surround a heredoc with quotes and you can continue the code on the same line:
 
    render :status => 404, :text => <<-'EOH' and return unless setup
Gravatar
Thu Aug 13 06:00:19 -0700 2009
1
2
3
#!/opt/ree/bin/ruby
# originally from http://griffin.oobleyboo.com/archive/ruby-enterprise-edition-gem-install-script/
#
Gravatar
Wed Aug 12 12:59:28 -0700 2009
1
2
3
# this script will migrate and reorganize a Paperclip attachments directory to utilize :id_partition
# Quickly put together by mario@orbitalvoice.com
# Assumes that your images to migrate < 1 000 000
Gravatar
Tue Jun 16 19:32:52 -0700 2009
1
2
3
#! /usr/bin/env ruby
# Lighter -- Campfire from the command line
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail ssl
Gravatar
Tue Jun 09 10:44:56 -0700 2009
1
2
3
rails_root = "/data/github/current"
 
20.times do |num|
Gravatar
Fri May 15 15:50:48 -0700 2009
1
2
ipd (dev)> Host.scoped(:conditions => { :enabled => true }).scoped(:conditions => ['free_ram > ?', 1024] )
Host Load (0.3ms) SELECT * FROM "hosts" WHERE ((free_ram > 1024) AND ("hosts"."enabled" = 't'))
Gravatar
Wed Apr 22 07:15:56 -0700 2009
1
2
3
require 'sinatra/metal'
 
class SinatraMetal < Sinatra::Base
Gravatar
Sat Apr 11 05:24:29 -0700 2009
1
2
3
# rails foo_name -m http://gist.github.com/93545.txt
# rake rails:template LOCATION=http://gist.github.com/93545.txt
 
Gravatar
Sun Apr 05 15:08:57 -0700 2009
1
2
3
# urlmonitor - print out the URLs requested system wide on the main network interface
 
# Accept a network interface name as an optional argument
Gravatar
Thu Mar 26 20:04:02 -0700 2009
1
2
3
require 'rack/hoptoad_notifier'
 
use Rack::HoptoadNotifier do |config|
Gravatar
Thu Mar 26 20:01:46 -0700 2009
1
2
3
# NAME: recaptcha
# VERSION: 1.0
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ]
Gravatar
Thu Mar 19 08:37:55 -0700 2009
1
2
3
class Date
  def self.next_weekday(original_date=Date.today)
    weekdays_from(original_date, 1)
Gravatar
Sun Feb 22 15:43:15 -0800 2009
1
2
# deploy to staging from your current topic branch, with ease
set :branch, "origin/#{`git branch`.scan(/^\* (\S+)/)}"
Gravatar
Wed Jan 28 15:17:45 -0800 2009
1
2
3
# Simple example of using ShadowFacter with RSpec to verify system configuration
# bradley @ http://railsmachine.com
#
Gravatar
Thu Jan 22 09:30:06 -0800 2009
1
2
3
# A Sinatra App as a Rails Plugin
#
# In your Edge Rails app:
Gravatar
Sun Nov 16 05:44:00 -0800 2008
1
2
3
global
  # maximum number of simultaneous active connections from an upstream web server
  maxconn 500