Skip to content

Instantly share code, notes, and snippets.

View waynegraham's full-sized avatar

Wayne Graham waynegraham

View GitHub Profile
config.active_record.colorize_logging = false
log_pipe = IO.popen("/usr/sbin/rotatelogs #{RAILS_ROOT}/log/quandu_staging_log.%Y%m%d 86400", 'a')
config.logger = Logger.new(log_pipe)
namespace :geoserver do
jetty_dir = ENV['dir'] || 'geoserver-2.0.1'
jetty_start_port = ENV['port'] || 8983
jetty_stop_port = ENV['stop_port'] || 8079
jetty_stop_key = ENV['stop_key'] || 'STOPME'
java_opts = 'Xmx512m -Xms512m'
desc 'Starts geoserver; will attempt to stop jetty/geoserver first.'
task :start=>['stop'] do
gem install --no-ri --no-rdoc bundler rails
gem install --no-ri --no-rdoc sqlite3-ruby heroku
#generate("cucumber")
#run("rm -rf features")
#git(:clone => "git://github.com/ultrasaurus/workshop-features.git")
#run("mv workshop-features features")
#inside("features") { run("rm -rf .git") }
rake("db:migrate")
#env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
heroku db:push mysql://root@localhost/deca_development?encoding=utf8
#!/usr/bin/env ruby
image_path = "archive/files"
thumbnail_path = "archive/thumbnails"
Dir["#{image_path}/*.jpg"].each do |image|
fname = File.basename(image)
puts "Converting #{fname}..."
`convert #{image_path}/#{fname} -thumbnail '300' -gravity Center +repage -strip #{thumbnail_path}/#{fname}`
#! /usr/bin/env ruby
base_path = "Surveys_Images"
dest_dir = 'footprints'
Dir["#{base_path}/**/*mages/*.pdf"].each do |pdf|
fname = File.basename(pdf, '.pdf')
puts "Converting #{fname}..."
`convert #{pdf.gsub(/ /, '\ ')} #{dest_dir}/#{fname.gsub(/ /, '')}.jpg`
end
#! /bin/bash
# Go into the library paths and updates git bundles
echo 'Updating Pristine copy in /Library/Application Support/TextMate/ Pristine Copy/Bundles'
find ~/"Library/Application Support/TextMate/Pristine Copy/Bundles" -name .git -execdir git pull --quiet \;
echo 'Updating /Library/Application Support/TextMate/Bundles'
find ~/"Library/Application Support/TextMate/Bundles" -name .git -execdir git pull --quiet \;
echo 'Updating Library/Application Support/TextMate/Pristine Copy/Bundles'
find ~/"Library/Application Support/TextMate/Pristine Copy/Bundles" -maxdepth 2 -name .svn -execdir svn up --quiet \;
echo 'Updating Library/Application Support/TextMate/Bundles'
@base_value = 5
@string_value = "This is awesome!!! "
def write_awesome_stuff
puts "Ruby is an awesome language"
end
def write_message(name)
puts "#{name} is an awesome programmer."
end
require 'open3'
require 'open-uri'
require 'rubygems'
require 'nokogiri'
search = 'rocket science'
results = open "http://search.lib.virginia.edu/catalog?q=#{URI.escape(search)}&per_page=2"
Open3.popen3('say -v Vicki') do |stdin, stdout, stderr|
stdin << "Virgo results for #{search}..."