Skip to content

Instantly share code, notes, and snippets.

View steveh's full-sized avatar

Steve Hoeksema steveh

View GitHub Profile
module Decorators
class Base < BasicObject
# perhaps make this include ActiveModel and behave like the underlying ActiveRecord
attr_reader :decorated
def initialize(decorated)
@decorated = decorated
end
@steveh
steveh / gist:788790
Created January 20, 2011 22:12
Bash script to start fcgiwrap
We couldn’t find that file to show.
Advanced > Folder References
File Pattern
!(/\.(?!htaccess)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp|.sqlite3)$
Folder Pattern
!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle)|log|tmp)$
@steveh
steveh / hidden_ckeditor.js
Created June 21, 2011 04:22
Cursor is not visible in Firefox if CKeditor is initially hidden
/*
If you have a CKeditor input field that is initially hidden, the cursor will not show up in Firefox 3.6 when you make it visible.
You can work around this by setting the contentEditable attribute of the iframe body to false and back to true.
Example jQuery snippet:
*/
$("form.ckeditor iframe").each(function (iframe) {
$(iframe[0].contentWindow.document.body).attr({ contentEditable: false }).attr({ contentEditable: true });
curl 'http://videos0.ordienetworks.com/videos/e8e4424115/sd.flv' > '01 - Michael Cera.flv'
curl 'http://videos0.ordienetworks.com/videos/f0e860bf5e/sd.flv' > '02 - Jimmy Kimmel.flv'
curl 'http://videos0.ordienetworks.com/videos/477f3b6bc5/sd.flv' > '03 - John Hamm.flv'
curl 'http://videos0.ordienetworks.com/videos/5ef1adb57b/sd.flv' > '04 - Natalie Portman.flv'
curl 'http://videos0.ordienetworks.com/videos/6ae880a42b/sd.flv' > '05 - Bradley Cooper.flv'
curl 'http://videos0.ordienetworks.com/videos/d14fdef4f2/sd.flv' > '06 - Charlize Theron.flv'
curl 'http://videos0.ordienetworks.com/videos/03b4a86265/sd.flv' > '07 - Conan O Brien and Andy Richter.flv'
curl 'http://videos0.ordienetworks.com/videos/60072add5a/sd.flv' > '08 - Ben Stiller.flv'
curl 'http://videos0.ordienetworks.com/videos/ed36fa1ab6/sd.flv' > '09 - Steve Carrell.flv'
curl 'http://videos0.ordienetworks.com/videos/41124b5136/sd.flv' > '10 - Sean Penn.flv'
I managed to build rdup on OSX by performing the following steps.
I don't use rdup-tr so haven't bothered to figure out how to build it.
I'm sure there is a better way to do this, but I'm not familiar enough with C or the configure/make ecosystem to know how.
1. Install glib (eg from homebrew)
2. git clone
3. autoreconf
@steveh
steveh / file-pattern.txt
Created August 15, 2011 00:13
Ignore Rails tmp folders in textmate
!(/\.(?!htaccess)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp|.sqlite3)$
class ActiveDecorator
include ::Rails.application.routes.url_helpers
def default_url_options
::ActionMailer::Base.default_url_options
end
attr_reader :decorated
#!/usr/bin/env ruby
host = '192.168.1.14'
map = {
# www
2 => { 80 => :tcp },
# mysql
3 => {},
require "pp"
namespace :fog do
task :setup => :environment do
$src_store = Fog::Storage.new(
:provider => "AWS",
:aws_access_key_id => Localist::Config[:amazon][:access_key_id],
:aws_secret_access_key => Localist::Config[:amazon][:secret_access_key],
:region => "us-west-1",