Skip to content

Instantly share code, notes, and snippets.

View jerodsanto's full-sized avatar
:shipit:
Always be shipping

Jerod Santo jerodsanto

:shipit:
Always be shipping
View GitHub Profile
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
#!/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.
#--
30 12 * * * ruby /tmp/vote_for_github.rb
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
require 'rubygems'
require 'benchmark'
gem = ARGV.shift.strip rescue ''
if gem == ''
STDERR.puts "usage: #{$0} [gem]"
exit 1
end
`free`
#!/usr/bin/env ruby
unless ARGV.length == 1
puts "Usage: #{__FILE__} [file to convert]"
exit
end
original_file = ARGV.first
sans_extension = original_file.gsub(/\.flv$/,"")
system "ffmpeg -i #{original_file} -b 192K #{sans_extension}.mp3"
ruby -i -pe '$_.gsub!("etch","lenny")' /etc/apt/sources.lst
#!/usr/local/bin/ruby
require 'resolv'
require 'rubygems'
require 'rb-skypemac'
include SkypeMac
def set_location(loc)
Skype.send_ :command => "SET PROFILE MOOD_TEXT #{loc}"
end
require 'ping'
unless ARGV.first =~ /\d+\.\d+\.\d+\.\d+/
puts "Bad Network address: #{ARGV.first}"
exit 1
end
$stdout = File.open(ARGV.last,"w") if ARGV.size == 2
class_c = ARGV.first.gsub(/\d+$/,"")
class Pickup < ActiveRecord::Base
validate_on_create :date_three_days_in_future
private
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
end
end