Skip to content

Instantly share code, notes, and snippets.

macbook:bb (master) $ time ../bin/testbot_cloud start
Starting 5 runners...
srv-hfme2 is being created...
srv-tigqo is being created...
srv-aap3y is being created...
srv-u61ix is being created...
srv-tigqo is up, installing testbot...
srv-u61ix is up, installing testbot...
srv-tigqo ssh connection failed, retrying...
srv-tigqo ssh connection failed, retrying...
@joakimk
joakimk / HipChatOptimized.user.css
Created April 21, 2011 22:19
Quick userscript to make HipChat more like irssi
div.input {
background-color: #555 !important;
border-top: 1px solid #aaa !important;
}
.topic_container {
background-color: #222 !important;
color: #aaa !important;
}
@joakimk
joakimk / bot.rb
Created April 29, 2011 06:05 — forked from jpr5/bot.rb
XMPP/Ruby Bot for HipChat with support for multiple rooms
#!/usr/bin/env ruby
require 'rubygems'
require 'xmpp4r'
require 'xmpp4r/muc/helper/simplemucclient'
# Most of this is borrowed from https://gist.github.com/941931
# Added support for multiple rooms and external handling of messages.
# We want the MUC functionality to just handle shit for us. Unfortunately we
# have to override/repeat the join method in order to add the directive that
@joakimk
joakimk / pivotalstatus.rb
Created June 23, 2011 11:37 — forked from aalin/pivotalstatus.rb
Pivotal tracker git status thing...
#!/usr/bin/env ruby
require 'rubygems'
require 'pivotal-tracker'
class String
ANSI_COLORS = [:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white]
def colorize(color)
num = ANSI_COLORS.index(color) or raise("Bad color #{ color }")
"\e[3#{ num }m" + self + "\e[0m"
@joakimk
joakimk / gist:1117167
Created July 31, 2011 20:15
Some simple ruby 1.9.3 benchmarks
The two rubies:
- 1.9.2 "ruby-1.9.2-p180-patched" (using https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch)
- 1.9.3 "ruby-1.9.3-preview1"
The app:
- Rails 3.1rc4 app with some scaffolds.
Results:
Ruby: Rails environment load time: Full spec suite: Unit tests:
@joakimk
joakimk / gist:1135095
Created August 9, 2011 20:22
Script to install GCC toolchain on OSX lion
curl http://cloud.github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7.pkg > /tmp/GCC-10.7.pkg &&
sudo installer -pkg /tmp/GCC-10.7.pkg -target /
@joakimk
joakimk / Example of output
Created August 21, 2011 18:14
Rake task for cleaner output when deploying with capistrano
$ rake deploy
> Executing deploy
> Executing deploy:update
> Executing deploy:update_code
> Executing deploy:finalize_update
> Executing bundle:install
> Executing link_config
> Executing link_files
> Executing build_assets
> Executing deploy:symlink
@joakimk
joakimk / gist:1185872
Created September 1, 2011 10:07 — forked from metaskills/gist:1124322
Patch Ruby 1.9.3.preview1 GC Tuning Noise
diff --git a/gc.c b/gc.c
--- a/gc.c
+++ b/gc.c
@@ -416,7 +416,6 @@
malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT");
if (malloc_limit_ptr != NULL) {
int malloc_limit_i = atoi(malloc_limit_ptr);
- printf("malloc_limit=%d (%d)\n", malloc_limit_i, initial_malloc_limit);
if (malloc_limit_i > 0) {
initial_malloc_limit = malloc_limit_i;
@joakimk
joakimk / migrate_with_annotation.rake
Created September 7, 2011 16:08
Script to automatically annotate models after db:migrate is run.
# Used with:
# gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
if Rails.env.development?
def after_task(task_name, &new_task)
old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
desc old_task.full_comment
task task_name do
old_task.invoke
new_task.call
@joakimk
joakimk / gist:1261080
Created October 4, 2011 07:32
Unit test results
......................................
Finished in 0.03768 seconds
38 examples, 0 failures
real 0m0.386s
user 0m0.344s
sys 0m0.038s
Later on...