Skip to content

Instantly share code, notes, and snippets.

View nverba's full-sized avatar
🏠
Working from home... Forever

Michael nverba

🏠
Working from home... Forever
View GitHub Profile
@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;
@nverba
nverba / index.html
Last active December 16, 2015 09:18 — forked from battlehorse/index.html
<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');
@nverba
nverba / partials.rb
Created February 10, 2012 16:57 — forked from lenary/partials.rb
# 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)
@nverba
nverba / scale.rake
Created January 16, 2012 23:18 — forked from samsm/scale.rake
"Auto" Scale Heroku Cedar instances with rake tasks
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.