Skip to content

Instantly share code, notes, and snippets.

View erlingur's full-sized avatar

Erlingur Þorsteinsson erlingur

View GitHub Profile
@erlingur
erlingur / keybase.md
Created August 14, 2014 23:07
keybase.md

Keybase proof

I hereby claim:

  • I am erlingur on github.
  • I am erlingur (https://keybase.io/erlingur) on keybase.
  • I have a public key whose fingerprint is D230 55B1 6A87 F2A6 7169 5F3D 08EE 25B9 AF3E 1A0B

To claim this, I am signing this object:

@erlingur
erlingur / upload.rake
Created May 30, 2014 16:37
Capistrano upload task
namespace :deploy do
task :upload do
files = (ENV["FILES"] || "").split(",").map { |f| Dir[f.strip] }.flatten
abort "Please specify at least one file or directory to update (via the FILES environment variable)" if files.empty?
on release_roles :all do
files.each { |file| upload!(file, File.join(current_path, file)) }
end
end
end
require 'action_dispatch/http/mime_type'
require 'action_view'
require 'active_support'
require 'writeexcel'
class WriteExcelTemplateHandler
def self.call(template)
%{
tmp = Tempfile.new('writeexcel')
workbook = WriteExcel.new(tmp.path)