Skip to content

Instantly share code, notes, and snippets.

View aguywithanidea's full-sized avatar

Richard Luck aguywithanidea

View GitHub Profile
@samsm
samsm / scale.rake
Created November 29, 2011 15:51
"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. Change 'YOUR-APPS-NAME' to indigo-butterfly-77 or whatever your app's name is.
@dangerouse
dangerouse / proxy.rb
Last active October 14, 2015 05:37
Cloudsponge Proxy Reference - Ruby
require 'cloudsponge'
def cloudsponge_proxy
url = Cloudsponge::URL_BASE + 'auth?' + request.query_string
response = Cloudsponge::Utility::get_url(url)
if response.is_a?(Net::HTTPRedirection)
redirect_to response["location"]
else
render :text => response.try(:body)
@adamloving
adamloving / example.js
Last active February 15, 2018 22:45
Beautiful Javascript. This is an example of what I think good Javascript formatting looks like (my style guidelines). Fork this and show me how you like it, or comment if I forgot anything.
// camel case variable names (no underscores)
// instance variables are nouns
var myArray = [1, 2, 3]; // space after commas
// title case for class names (class names should be nouns)
// space before bracket
function Widget() {
// two spaces for indentation
var parameterOne = 1;
var parameterTwo = 2;

Estimation

This document is an attempt to pin down all the things you don't think about when quoting for a project, and hopefully provide a starting point for some kind of framework to make quoting, working and delivering small-medium jobs more predictable and less stressful.

Contents