This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some credits: | |
# Code this verions is based on: Andrew Birkett | |
# http://www.nobugs.org/developer/ruby/method_finder.html | |
# Improvements from _why's blog entry | |
# * what? == - _why | |
# * @@blacklist - llasram | |
# * $stdout redirect - _why | |
# http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html | |
# Improvements from Nikolas Coukouma | |
# * Varargs and block support |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :test do | |
task :populate_testopts do | |
if ENV['TESTNAME'].present? | |
ENV['TESTOPTS'] = ENV['TESTOPTS'] ? "#{ENV['TESTOPTS']} " : '' | |
ENV['TESTOPTS'] += "--name=#{ENV['TESTNAME'].inspect}" | |
end | |
end | |
end | |
%w(test:units test:functionals test:integration).each do |task_name| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Annoying.js - How to be an asshole to your users | |
* | |
* DO NOT EVER, EVER USE THIS. | |
* | |
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
* Visit https://gist.github.com/767982 for more information and changelogs. | |
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
textmate_bundle_path = File.expand_path('~/Library/Application Support/TextMate/Bundles/') | |
Dir.chdir(textmate_bundle_path) | |
bundles = Dir.glob('*.tmbundle') | |
bundles.each do |bundle| | |
Dir.chdir(File.join(textmate_bundle_path, bundle)) | |
puts %( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Capistrano recipe to tail log files on remote servers and open them in Textmate | |
namespace :log do | |
namespace :mate do | |
unset :_log | |
%w(access error production).each do |file| | |
desc "View #{file}.log from remote server in Textmate." | |
task file.to_sym, :roles => :app do | |
set :_log, file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pm - Print methods of objects in irb/console sessions. | |
# Goes in ~./irbrc | |
# | |
begin # Utility methods | |
def pm(obj, *options) # Print methods | |
methods = obj.methods | |
methods -= Object.methods unless options.include? :more | |
filter = options.select {|opt| opt.kind_of? Regexp}.first | |
methods = methods.select {|name| name =~ filter} if filter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |