Skip to content

Instantly share code, notes, and snippets.

View mperham's full-sized avatar

Mike Perham mperham

View GitHub Profile
require 'nokogiri'
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
xml.feed(
:xmlns => 'http://www.w3.org/2005/Atom',
'xmlns:osa' => 'http://www.onespot.com/Atom/Extensions/1.0'
) do
xml.title 'feed title', :type => "html"
@mperham
mperham / README
Created March 25, 2010 12:26 — forked from qrush/README
There's got to be a faster way. This is with a production db dump from a few days ago.
% time rake gemcutter:migrate:downloads
> gemcutter (0.5.0) 131783
>> 0.5.0 19314
>> 15
>> 0.5.0.pre.2 64
>> 15
>> 0.5.0.pre 45
>> 14
@mperham
mperham / gist:558145
Created August 30, 2010 22:23 — forked from zzak/gist:558001
get '/' do
dc = Dalli::Client.new('localhost:11211')
@info = dc.fetch("info-#{userid}-#{repoid}") do
HTTParty.get("#{base_uri}/repos/show/#{userid}/#{repoid}"))
end
@collaborators = dc.fetch("collaborators-#{userid}-#{repoid}") do
HTTParty.get("#{base_uri}/repos/show/#{userid}/#{repoid}/collaborators"))
end