Skip to content

Instantly share code, notes, and snippets.

View cbrunnkvist's full-sized avatar

Conny Brunnkvist cbrunnkvist

View GitHub Profile
<% iterations.each do |iteration| %>
<h2 id='Sprint_<%= iteration.number %>' style='display:inline'>Sprint <%= iteration.number %></h2><i> - ends <%= iteration.finish.strftime("%Y-%m-%d") %></i><a href='#Sprint_<%= iteration.number %>' class='anchor'>&nbsp;&para;</a>
<ul>
<% iteration.stories.each do |story| %>
<li class='story'><h3 style='display:inline'><i>Story <%= story.id %> (<%= story.current_state %>)</i></h3>
<small class='taskCount'><i><%= " - #{story.tasks.size} tasks defined" if story.respond_to?(:tasks) %></i></small>
<p class='storyDescription'><span class="storyIngress"><%= story.name%></span><br><span class="storyRest" style="color:grey"></span></p>
<% end %>
</ul>
<% end %>
@cbrunnkvist
cbrunnkvist / db_cloning.rb
Created May 14, 2010 14:06
capistrano mysqldump hack
# Used for copying ALL data from one Rails env to another.
# To prep the "training" environment with a copy of the latest production dataset:
# $ cap training db:clone_from_production
#
# Bonus feature: You can specify which host to go via, useful for tunneling:
# $ cap development db:clone_from_staging HOSTS=ssh-gateway.remotesite.com
namespace :db do
CONFIG = YAML.load(ERB.new(File.read("config/database.yml")).result)
#Premature optimization: supports several source environments! :-)
@cbrunnkvist
cbrunnkvist / Rake-task-for-Cucumber-output--Hudson--JUnit--XML.patch
Created July 2, 2010 11:53
ci_reporter rake task for making Cucumber output Hudson (JUnit) XML
From 24aa2efa9d59da352f21b7bfac75cba03b4a11e0 Mon Sep 17 00:00:00 2001
From: Conny Brunnkvist <[email protected]>
Date: Fri, 2 Jul 2010 12:30:09 +0100
Subject: [PATCH] Rake task for Cucumber output: Hudson (JUnit) XML
---
lib/tasks/ci_setup_cucumber_replacement.rake | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
create mode 100644 lib/tasks/ci_setup_cucumber_replacement.rake
@cbrunnkvist
cbrunnkvist / Adding-Bundler-compat-patches-for-Rails-2-3-8.patch
Created July 2, 2010 11:54
Adds bundler loader to Rails 2.3.x projects
From ce29c8fe3a51a4652c0942e4995bdebd0871dc06 Mon Sep 17 00:00:00 2001
From: Conny Brunnkvist <[email protected]>
Date: Tue, 22 Jun 2010 12:02:58 +0100
Subject: [PATCH] Adding Bundler-compat patches for Rails 2.3.8
---
config/boot.rb | 16 +++++++++++++++-
config/preinitializer.rb | 21 +++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletions(-)
create mode 100644 config/preinitializer.rb
@cbrunnkvist
cbrunnkvist / gist:602983
Created September 29, 2010 15:45
Rails ActiveRecord aware fork() wrapper
# Rails ActiveRecord aware fork() wrapper
$child_pids = []
def wait_for_child(pid=nil)
begin
pid, child_result = (pid.nil? ? Process.wait2 : Process.waitpid2(pid))
unless child_result.exitstatus.zero?
$child_pids.each {|child_pid| Process.kill('TERM', child_pid) rescue true}
raise "Child PID:#{pid} exited with status #{child_result.exitstatus} - batch aborting"
end
rescue Errno::ECHILD
@cbrunnkvist
cbrunnkvist / my.cnf
Created October 19, 2010 10:47
#mysql Ver 14.14 Distrib 5.1.38, for apple-darwin9.5.0 (i386) using readline 5.1
[mysqld]
#Port number to use for connections.
port=3306
#### Values to lower while debugging timeout errors ####
#The number of seconds the server waits for activity on a connection before closing it
#wait_timeout=10
#The number of seconds the server waits for activity on an interactive connection before closing it.
#interactive_timeout=10
#The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
@cbrunnkvist
cbrunnkvist / push-config-submodule.sh
Created November 8, 2010 17:24
Script for push & synch of updates to git submodule
#!/bin/sh
set -x
git pull
git submodule update
pushd config/private/
git stash
git checkout master
git pull
git stash pop
git add .
@cbrunnkvist
cbrunnkvist / mongrel_cluster_ctl.1_9.diff
Created November 16, 2010 19:37
mongrel_cluster-1.0.5/bin/mongrel_cluster_ctl Ruby 1.9(.2) compatibility patch
53c53
< when "start":
---
> when "start"
56c56
< when "stop":
---
> when "stop"
59c59
< when "restart":
@cbrunnkvist
cbrunnkvist / .bashrc
Created April 26, 2011 13:06
Make RVM work when installed outside (=not in) $HOME even if called from cron
export rvm_path=/psg/ruby/rvm
export rvm_scripts_path=$rvm_path/scripts
[[ -s "$rvm_scripts_path/rvm" ]] && . "$rvm_scripts_path/rvm" # using rvm 1.6.4
From 636f9f7d31acf1ac75d7e5db4cf968c4ff376dc0 Mon Sep 17 00:00:00 2001
From: Conny Brunnkvist <[email protected]>
Date: Mon, 20 Jun 2011 18:43:51 +0100
Subject: [PATCH] Just a little wrapper script for maintenance tasks
---
all-apps-all-envs.sh | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
create mode 100755 all-apps-all-envs.sh