Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Perham mperham

View GitHub Profile
View gist:558145
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
View 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
View builder.rb
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"