Skip to content

Instantly share code, notes, and snippets.

View tonycoco's full-sized avatar

Tony Coconate tonycoco

View GitHub Profile
@tonycoco
tonycoco / pow_debugger
Created April 10, 2012 03:54
POW! Debugger
# Debugging with POW!
#
# Setup POW!'s ~/.powconfig with the following:
# export POW_WORKERS=1
# export POW_TIMEOUT=3600
#
# Run `bundle exec rdebug -c` in the Terminal to start the debugger
if (Rails.env.development? || Rails.env.test?) && !(defined?($rails_rake_task) && $rails_rake_task)
puts "=> Debugger enabled"
@tonycoco
tonycoco / gist:1528711
Created December 28, 2011 17:08
TextMate Patterns
File:
!(/\.(?!htaccess)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$
Folder:
!.*/(\.[^/]*|doc|log|solr|public/uploads|public/system|tmp|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
@tonycoco
tonycoco / My IRBRC
Created April 1, 2011 15:21
Just a few good things to do for your Rails 3 applications in IRBRC
%w[rubygems wirble pp ap].each do |gem_name|
begin
require gem_name
rescue LoadError => err
warn "Please do: gem install #{gem_name.sub(/\/.*/,'')}"
end
end
Wirble.init
Wirble.colorize
@tonycoco
tonycoco / jmeterxmltocsv.rb
Created November 3, 2010 19:58
A quick script to convert JMeter log XML files to CSV files for Excel imports (Since, Excel can't import XML data... wow.)
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
XML_FILE = ARGV[0]
CSV_FILE = ARGV[1]
if XML_FILE.nil? || CSV_FILE.nil?
puts 'usage: ruby jmeterxmltocsv.rb source_file target_file'
# Get this working in an initializer...
%w(zipcode, city, designated_market_area, core_based_statistical_area).each do |t|
Zips::<t's classified name here>.set_schema("")
Zips::<t's classified name here>.set_table_name("zips_#{t.pluralize}")
end