Skip to content

Instantly share code, notes, and snippets.

@wesrog
wesrog / state_codes.rb
Created November 13, 2008 21:52
Ruby array for state codes
STATE_CODES = [
['AL', 'ALABAMA'],
['AK', 'ALASKA'],
['AZ', 'ARIZONA'],
['AR', 'ARKANSAS'],
['CA', 'CALIFORNIA'],
['CO', 'COLORADO'],
['CT', 'CONNECTICUT'],
['DE', 'DELAWARE'],
['DC', 'DISTRICT OF COLUMBIA'],
ActionController::Routing::Routes.draw do |map|
map.namespace :admin do |admin|
admin.resources :manufacturers
end
end
ActionController::Routing::Routes.add_configuration_file(File.join(RAILS_ROOT, 'config', 'routes_custom.rb'))
#!/usr/bin/env ruby
# ABSTRACT
# This file is to be executed by a cron script that is setup on a local server
# PROCESS
# 1. Load Rails environment and make connection to database
# 2. Get list of operators, get orders which have an agent that belongs to that partner to operator
# 3. With that list of orders, create the Excel spreadsheet
# 4. Mail spreadsheet to operator (CC to mycablehome)
# 5. Create record in Leads table with a reference to the spreadsheet
require 'rubygems'
require 'rbosa'
require 'net/http'
require 'cgi'
require 'rexml/document'
include REXML
itunes = OSA.app('iTunes')
track = itunes.current_track
begin require 'rubygems'; rescue LoadError; end
require 'rbosa'
require 'net/http'
require 'cgi'
require 'rexml/document'
include REXML
itunes = OSA.app('iTunes')
selection = itunes.selection.get
if selection.empty?
// v0.2
//
// ==UserScript==
// @name eMusic.fm
// @namespace http://633k.net
// @description Get tags for album from last.fm
// @include http://emusic.com/album/*
// @include http://www.emusic.com/album/*
// ==/UserScript==
@wesrog
wesrog / lastfm_tagger.rb
Created December 5, 2008 18:28
Last.fm Tagger CLI
# Last.fm Tagger v0.7
#
# Author:
# [email protected]
#
# Abstract:
# For each selected track in iTunes, retrieve the genre from Last.fm and accordingly tag the track.
# Use -q to subdue confirmations
#
# Todo:
@wesrog
wesrog / gemrc
Created February 16, 2009 22:40
:update_sources: true
:sources:
- http://gems.rubyforge.org/
- http://gems.github.com
:benchmark: false
:bulk_threshold: 1000
:backtrace: false
:verbose: true
gem: --no-ri --no-rdoc
LoadModule passenger_module /Users/wes/src/passenger/ext/apache2/mod_passenger.so
PassengerRoot /Users/wes/src/passenger
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
NameVirtualHost *:80
# Added by the Passenger preference pane
# Make sure to include the Passenger configuration (the LoadModule,
# PassengerRoot, and PassengerRuby directives) before this section.