Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am pallan on github.
  • I am peerallan ( on keybase.
  • I have a public key whose fingerprint is B53D 42AA 582B C8D2 56BF 9F2D E8FC 7A53 71EE 8B3C

To claim this, I am signing this object:

The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
View rails_issue_13775.rb
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source ''
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
system 'bundle'
View gist:7109019
if defined?(PhusionPassenger)
require 'phusion_passenger/rack/out_of_band_gc'
require 'phusion_passenger/public_api'
# Trigger out-of-band GC every 5 requests.
config.middleware.use PhusionPassenger::Rack::OutOfBandGc, 5
# NewRelic Garbage Collection Monitoring
View chiliproject_to_redmine.rb
# encoding: UTF-8
# Chiliproject to Redmine converter
# =================================
# This script takes an existing Chiliproject database and
# converts it to be compatible with Redmine (>= v2.3). The
# database is converted in such a way that it can be run multiple
# times against a production Chiliproject install without
# interfering with it's operation. This is done by duplicating
View gist:4078881
if a || b == d || c != n # lets check a bunch of conditions
if m <= p && a > n # we passed! ok, let's check some more
puts 'YAY' # we passed again!
end # I guess that's all we really needed
end # fine!
View gist:4001241
#!/usr/bin/env ruby
current_branch =`git symbolic-ref HEAD`.chomp.split('/').last
issue_id = current_branch[/\d+/].to_i
commit_message =
matches = /^[rmRM\s-]*#\d*(.*)$/.match(commit_message)
commit_message = matches[1].strip if matches
if commit_message == ''
puts "Aborting commit due to empty commit message."
View gist:1323595
// Add a clickable plus (+) sign after a select element that when clicked
// toggles the multiple attribute on the select box
// obviously it could use some options for the toggle element, styling or
// the select size
multiSelectToggle : function(options){
//Settings list and the default values
var defaults = {
label: '+'