This file contains hidden or 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
@import url(https://fonts.googleapis.com/css?family=Fira+Mono|Fira+Sans:400,700); | |
html{ | |
font:18px/1.5 'Fira Sans', sans-serif; | |
color:rgb(55,71,79); | |
} | |
body{ | |
background:#fefefe; | |
font:1rem; | |
margin:2rem 1rem; |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> | |
<script> | |
function getImgData(chartContainer) { | |
var chartArea = chartContainer.getElementsByTagName('svg')[0].parentNode; | |
var svg = chartArea.innerHTML; | |
var doc = chartContainer.ownerDocument; | |
var canvas = doc.createElement('canvas'); |
This file contains hidden or 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
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb | |
# and made a lot more robust by me | |
# this implementation uses erb by default. if you want to use any other template mechanism | |
# then replace `erb` on line 13 and line 17 with `haml` or whatever | |
module Sinatra::Partials | |
def partial(template, *args) | |
template_array = template.to_s.split('/') | |
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}" | |
options = args.last.is_a?(Hash) ? args.pop : {} | |
options.merge!(:layout => false) |
This file contains hidden or 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
I think this is a nice option for apps that are mostly used during particular hours and aren't really ready | |
for a more intense auto-scaling thing. Hirefire (https://github.com/meskyanichi/hirefire) likely does a | |
lot more, but I didn't really understand how it worked and don't really need something that fancy right now. | |
I suspect it requires at least one worker itself, but I don't really know. | |
Add an API key to your app's Heroku config | |
heroku config:add HEROKU_API_KEY=your_key (from https://api.heroku.com/account ) | |
Add the above rake task. |