Skip to content

Instantly share code, notes, and snippets.

@samvincent
samvincent / index_pagination_override.rb
Created January 19, 2012 17:52
Remove download links from index
module ActiveAdmin
module Views
module Pages
class Index < Base
protected
def render_index
renderer_class = find_index_renderer_class(config[:as])
@samvincent
samvincent / basecamp-time-report-prettyprint.rb
Created November 16, 2009 16:51
Format my basecamp time-report.csv files so I can paste easily in freshbooks
#!/usr/bin/env ruby
require 'csv'
require 'date'
CSV::Reader.parse(File.open(ARGV[0])) do |row|
date = row[0].match(/^\d{4}-\d{2}-\d{2}/) ? Date.strptime(row[0], "%Y-%m-%d") : row[0]
hours = row[2]
memo = "#{row[3]} #{row[4]}"
puts "#{date} | #{hours} | #{memo}"
end
@samvincent
samvincent / email_list.rb
Created June 7, 2009 01:56
Quickly add friends to an email list you'll set up some day.
#!/usr/bin/env ruby
require 'rubygems'
require 'yaml'
# Add users quickly from command line to email_list.txt
# usage is:
# $ ruby email_list.rb [name] [email]
name, email = ARGV
file_name = 'email_list.txt'