Skip to content

Instantly share code, notes, and snippets.

View mewdriller's full-sized avatar

Drew Miller mewdriller

View GitHub Profile
@seanadkinson
seanadkinson / example-route.js
Last active July 10, 2017 03:49
Merging react-router with react-proxy-loader to load bundles on page change
<Router.Route path="/home" handler={require('react-router-proxy!./Home.jsx')}/>
@nathany
nathany / config.ru
Last active May 3, 2019 17:10
Magical Unicorn Configuration for Heroku
# add something like this to config.ru
# see https://github.com/kzk/unicorn-worker-killer
if Integer(ENV['UNICORN_KILLER'] || 0) != 0
require 'unicorn/worker_killer'
# Max memory size (RSS) per worker
use Unicorn::WorkerKiller::Oom, (350*(1024**2)), (400*(1024**2)), 30, true
end
/*
* add this to your own css file,
* to overwrite the _chosen_ styling, to look more like bootstrap!
*
* note: for the error part to work, an .error class-name must be added
* to a wrapping DIV, to display the bootstrap error styling. I have
* just use the wrapping .control-group DIV
*
* credit: Rasmus Burkal, @rabu81
* Drew Miller, @mewdriller
@kylefritz
kylefritz / HandlebarsBundleTransform.cs
Created July 6, 2012 13:54
Compile Handlebars Templates in .net mvc
using System.IO;
using System.Text;
using System.Web;
using System.Web.Optimization;
using Jurassic;
using System.Globalization;
namespace Fewt.Web
{
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("")
base = alphabet.length
exports.encode = (i) ->
return alphabet[0] if i is 0
s = ""
while i > 0
s += alphabet[i % base]
i = parseInt(i / base, 10)