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 / 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 / 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
@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 / _README.md
Created November 19, 2009 21:45 — forked from kneath/_README.md

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
@netzpirat
netzpirat / sendQuotaMail.sh
Created January 17, 2010 18:04
Check vmail quota and send user notification
#!/bin/bash
VMAIL_HOME=/usr/local/vmail
cd $VMAIL_HOME
for d in `ls -d *.ch`
do
for u in `ls $d`
do
cd $VMAIL_HOME/$d/$u