Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
git filter-branch --env-filter '
an=$GIT_AUTHOR_NAME
am=$GIT_AUTHOR_EMAIL
cn=$GIT_COMMITTER_NAME
cm=$GIT_COMMITTER_EMAIL
if [ $GIT_COMMITER_EMAIL == "your@email" ]
jgem install hpricot -v 0.6.164
require 'helpers'
class HelpersTest < Test::Unit::TestCase
def setup
@helper = Object.new
@helper.extend(Oahu::Helpers)
end
def test_get_username

HOWTO: iPhone AT&T Tethering

In 10 steps:

  • Update iTunes to 8.2 via Software Update
  • Update your iPhone to the 3.0 release (out today - June 17th)
  • Download this dmg and mount it: tethering file
  • Enable hidden carrier testing option (in Terminal.app): defaults write com.apple.iTunes carrier-testing -bool TRUE
  • Start up iTunes
@nirvdrum
nirvdrum / 0what.md
Created August 24, 2009 12:49 — forked from defunkt/0what.md

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

# Comment if you dont want rubygems
require 'rubygems'
require 'gitauth'
require 'fileutils'
if ARGV.empty?
puts "Usage: ruby #{$0} path-to-base-dir"
exit!
end
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count
ActiveRecord::Base.connection.transaction do
moderate_task = ModerateImageJob.new(photo_id)
job = Delayed::Job.enqueue(moderate_task)
moderate_task.job_id = job.id
job.payload_object = moderate_task
job.save!
end
stylesheet_link_tag(AssetCache::BASE_CSS, :cache => 'cached/base')