<%= objective %>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'httparty' | |
module Upcoming | |
class Base | |
include HTTParty | |
format :xml | |
def self.api_key=(api_key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"CkIASHw9cSp7ImA9WxdaGEg.""><id>tag:blogger.com,1999:blog-6867964</id><updated>2008-08-27T11:22:29.269-04:00</updated><title>idiosyncranomicon</title><subtitle type="html" /><link rel="alternate" type="text/html" href="http://idiosyncranomicon.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6867964/posts/default?start-index=26&max-results=25&redirect=false&v=2" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://idiosyncranomicon.blogspot.com/feeds/posts/default" /><author><name>Kevin</name><ema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# module: audit2 | |
class Audit < Thor | |
desc "all", "Run all audit tasks" | |
def all | |
%w(architecture database stats tests coverage flog roodi filesize queries).each do |task| | |
log "\n*** reviewing #{task}", true | |
log `thor audit:#{task}`, true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Photo < ActiveRecord::Base | |
belongs_to :user | |
def self.flickr_mapping | |
{ | |
:flickr_id => :id, | |
:description => :description, | |
:title => :title, | |
:url => 'small.url' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :content do | |
desc "Convert old-style code blocks to new format" | |
task :convert_code => :environment do | |
require 'hpricot' | |
Post.all.each do |post| | |
doc = Hpricot(post.body) | |
(doc/'code').each do |node| | |
header = node['lang'] ? " #lang:#{node['lang']}\n" : '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Response | |
def initialize(source_uri) | |
@source_uri = source_uri | |
@last_response = nil | |
end | |
def http_response_for(uri) | |
Net::HTTP.start(uri.host, uri.port) do |http| | |
@last_response = http.get(path_for(uri), 'User-Agent' => user_agent) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'graft' | |
require 'time' | |
class AccountList | |
include Graft::Model | |
attribute :id | |
attribute :author, :from => 'author/name' | |
attribute :count, :from => 'openSearch:totalResults' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_dir=`pwd` | |
for dir in `find . -type d | grep -v .svn | sort -r`; do | |
cd $dir | |
echo "cleaning $dir" | |
svn cleanup | |
cd $start_dir | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::Routing::Routes.draw do |map| | |
map.resources :users, :only => [:show] | |
map.page 'page/*permalink', :controller => 'pages', :action => 'show' | |
end |
OlderNewer