Skip to content

Instantly share code, notes, and snippets.

View netzpirat's full-sized avatar

Michael Kessler netzpirat

View GitHub Profile
@netzpirat
netzpirat / gist:107768
Created May 6, 2009 21:53 — forked from stephencelis/gist:72794
Global Capistrano recipes
# ~/.caprc
Dir["#{ENV['HOME']}/.recipes/*.rb"].each do |tasks|
load tasks
end
@netzpirat
netzpirat / growl.rb
Created May 6, 2009 21:54 — forked from stephencelis/growl.rb
Capistrano recipe for Growl notifications
# ~/.recipes/growl.rb
set :stage, nil unless defined? stage
namespace :growl do
task :notify do
growl_send(ENV["GROWL_MESSAGE"] || "wants your attention")
end
task :alert do
growl_send(ENV["GROWL_MESSAGE"] || "needs your attention", 2)
@netzpirat
netzpirat / deploy.rb
Created May 14, 2009 10:06
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
@netzpirat
netzpirat / macclean.sh
Created September 9, 2009 13:48
Clean up macports and rubygems
sudo port clean --all installed
sudo port -f uninstall inactive
gem cleanup
@netzpirat
netzpirat / Install mysql gem on os x with macports installed mysql
Created September 11, 2009 22:17
Compile MySql RubyGem on Snow Leopard
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
@netzpirat
netzpirat / resize.rb
Created October 23, 2009 22:21
A simple ruby script generate image previews
#!/usr/bin/env ruby
# A simple ruby rmagick resize script.
#
# Example: ./resize.rb /user/joe/mypics 400 533
#
# Searches /user/joe/mypics recursively for all files ending with 'jpg'; the search is case
# insensitive. The found image will be proprtinaly scaled to a max width of 400 pixels and
# a max height of 533 pixels. The resized image will be written to a new file with the
# extension 'preview.jpg'
@netzpirat
netzpirat / Info.plist
Created November 16, 2009 16:07
RubyMine GC Performance Tuning
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>rubymine</string>
<key>CFBundleIconFile</key>
<string>rubymine.icns</string>
@netzpirat
netzpirat / env.rb
Created November 18, 2009 19:22
Cucumber ActiveResource faking
require 'fakeweb'
require 'fake_resource'
ActiveResource::Base.send :include, ActiveResource::FakeResource
Before do
FakeWeb.allow_net_connect = false
end
After do |scenario|
ActiveResource::FakeResource.clean
@netzpirat
netzpirat / gist:238162
Created November 18, 2009 19:29
Running webrat and celerity parallel
We couldn’t find that file to show.
@netzpirat
netzpirat / snow_leopard.yml
Created November 18, 2009 19:47
Using gem bundler on snow leopard
mysql:
mysql-config: /opt/local/lib/mysql5/bin/mysql_config