Skip to content

Instantly share code, notes, and snippets.


Sam Vincent samvincent

View GitHub Profile
samvincent / index_pagination_override.rb
Created Jan 19, 2012
Remove download links from index
View index_pagination_override.rb
module ActiveAdmin
module Views
module Pages
class Index < Base
def render_index
renderer_class = find_index_renderer_class(config[:as])
samvincent / basecamp-time-report-prettyprint.rb
Created Nov 16, 2009
Format my basecamp time-report.csv files so I can paste easily in freshbooks
View basecamp-time-report-prettyprint.rb
#!/usr/bin/env ruby
require 'csv'
require 'date'
CSV::Reader.parse([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}"
samvincent / email_list.rb
Created Jun 7, 2009
Quickly add friends to an email list you'll set up some day.
View email_list.rb
#!/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'
You can’t perform that action at this time.