Skip to content

Instantly share code, notes, and snippets.

Always be shipping

Jerod Santo jerodsanto

Always be shipping
Block or report user

Report or block jerodsanto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4393
irb(main):001:0> require 'models'
=> true
irb(main):002:0> DataMapper.setup(:default, "sqlite3://test.sqlite3")
=> #<DataMapper::Adapters::Sqlite3Adapter:0x2b3089430d48 @name=:default, @field_naming_convention=DataMapper::NamingConventions::Underscored, @resource_naming_convention=DataMapper::NamingConventions::UnderscoredAndPluralized, @uri=#<Addressable::URI:0x159844a14108 URI:sqlite3://test.sqlite3>, @transactions={}>
irb(main):003:0> DataMapper.auto_migrate!
Segmentation fault
View git_watch.rb
#!/usr/bin/env ruby
# Name : git_watch.rb
# Author : Jerod Santo
# Contact : "moc.liamg@otnas.dorej".reverse
# Date : 2008 October 14
# About : Checks a git repository for changes and emails provided email
# address if changes have been made. Schedule with cron.
View crontab
30 12 * * * ruby /tmp/vote_for_github.rb
View gist:44423
# 1) Point * in your DNS setup to your server.
# 2) Setup an Apache vhost to catch the star pointer:
# <VirtualHost *:80>
# ServerName *
# </VirtualHost>
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
View gemweight.rb
require 'rubygems'
require 'benchmark'
gem = ARGV.shift.strip rescue ''
if gem == ''
STDERR.puts "usage: #{$0} [gem]"
exit 1
View gist:62249
#!/usr/bin/env ruby
unless ARGV.length == 1
puts "Usage: #{__FILE__} [file to convert]"
original_file = ARGV.first
sans_extension = original_file.gsub(/\.flv$/,"")
system "ffmpeg -i #{original_file} -b 192K #{sans_extension}.mp3"
View gist:65318
ruby -i -pe '$_.gsub!("etch","lenny")' /etc/apt/sources.lst
View skype_where_is.rb
require 'resolv'
require 'rubygems'
require 'rb-skypemac'
include SkypeMac
def set_location(loc)
Skype.send_ :command => "SET PROFILE MOOD_TEXT #{loc}"
View gist:92714
require 'ping'
unless ARGV.first =~ /\d+\.\d+\.\d+\.\d+/
puts "Bad Network address: #{ARGV.first}"
exit 1
$stdout =,"w") if ARGV.size == 2
class_c = ARGV.first.gsub(/\d+$/,"")
View pickup.rb
class Pickup < ActiveRecord::Base
validate_on_create :date_three_days_in_future
def date_three_days_in_future
errors.add_to_base "must be at least 3 days from now" unless date >= 3.days.from_now.to_date
You can’t perform that action at this time.