Skip to content

Instantly share code, notes, and snippets.

View inkdeep's full-sized avatar

Jeremy Kleindl inkdeep

View GitHub Profile
@inkdeep
inkdeep / custom cucumber rake tasks
Created March 12, 2009 17:39
custom rake tasks for cucumber - made running single feature(s) easier
require 'rubygems'
require 'cucumber/rake/task'
begin
task :features => 'db:test:prepare'
task :features => "features:all"
namespace :features do
desc 'Run All Features'
Cucumber::Rake::Task.new(:all) do |t|
require 'colored'
def banner(title, pad = 85)
puts "\n#{title} ".ljust(pad, "*").yellow
end
def stripe
puts ("-" * 84 + "\n").yellow
end
<style type="text/css" media="screen">
#spotlight {zoom:1; z-index:1;
width:390px;
margin:5px 0 0 5px;
min-height:400px;
display: -moz-inline-stack;
display: inline-block;
vertical-align: top;
zoom: 1;
*display: inline;
respond_to do |format|
format.js {render :update do |page|
page.replace_html :deal_object_selector, :partial => "configure_"+@class_type.underscore, :locals => {:deal => deal, :f => nil}
page.hide :deal_object_selector
page.visual_effect :appear, :deal_object_selector, :duration => 0.5
end}
end
#!/usr/bin/env ruby
HELP = <<EOS
git-wtf displays the state of your repository in a readable and easy-to-scan
format. It's useful for getting a summary of how a track branch relates to a
remote server, and for understanding how feature branches and relate to
integration branches.
git-wtf can show you:
- How a branch relates to the remote repo, if it's a tracking branch.
#!/usr/bin/env ruby
# Complete rake tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default rake
# to your ~/.bashrc
# Nicholas Seckar <nseckar@gmail.com>
# Saimon Moore <saimon@webtypes.com>
# http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces
#!/usr/bin/env ruby
require 'rubygems'
require 'highline'
require 'xmlsimple'
# Retrieves stories a user owns from PivotalTracker API
# Formats the name and story number for pivotial friendly commit messages.
#
# Add this to .bash_profile or .bashrc and replace the values with your information:
# ## pivotal tracker API call variables
@inkdeep
inkdeep / ptstories.rb
Created November 24, 2009 21:21
Ruby shell script to get 'My Stories' from PivotalTracker and format them for github to pivotal api friendliness
#!/usr/bin/env ruby
require 'rubygems'
require 'highline'
require 'xmlsimple'
require 'uri'
# Retrieves stories a user owns from PivotalTracker API
# Formats the name and story number for pivotial friendly commit messages.
#
# Add this to .bash_profile or .bashrc and replace the values with your information:
TVEL - TOM'S VISCIOUSLY EVIL LICENSE
Version 2, June 2000
Copyright (C) 2000 Tom Gilbert.
Everyone is permitted to copy and distribute verbatim copies of
this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
// Finds the longest common starting substring in an array of strings
function common_substring(data) {
var i, ch, memo, idx = 0
do {
memo = null
for (i=0; i < data.length; i++) {
ch = data[i].charAt(idx)
if (!ch) break
if (!memo) memo = ch
else if (ch != memo) break