Skip to content

Instantly share code, notes, and snippets.

View jmervine's full-sized avatar

Joshua Mervine jmervine

View GitHub Profile

Status: New

Notes on building out a new instance of stats.heroku.com on the platform.

heroku create --space sre-oregon --org heroku-sre --region oregon status-integration

# addons
heroku addons:create memcachier:100 -a status-integration
heroku addons:create pusher:startup -a status-integration
/*Example Usage:
*
* $ PORT=3000 HOST=0.0.0.0 STATIC=./static PROXY_TARGET=http://localhost:5000 PROXY_PATH=/api go run main.go
*/
package main
import (
"fmt"
"log"

How-to: Vendoring Ruby Gems

Outstanding Questions

A list of outstanding questions to be answered before finalizing this document.

  • How does on update vendored gems? Are the automatically updated when you run bundle update or do you have to run bundle package again?
  • How do you tell Heroku's build process to use bundle install --local --no-prune when building the build pack?
# assuming your tag is '1.0.1'
# ensure latest code is local
git fetch --all --tag
# create branch off tag
git checkout -b branch-off-1.0.1 1.0.1
# your current branch should now be 'branch-off-1.0.1'
# ensure branch matches tag [optional]
var assert = require('assert');
var exec = require('child_process').execFileSync;
// execFileSync throw an error if it returns a non-zero exit status
assert(exec('./index.js'));
/*
For the above to work index.js needs:
1. to be executable (i.e. 0755)
2. it's first line to contain `#!/usr/bin/env node`
var assert = require('assert');
var foo = 'foo';
assert.equal('foo', foo);
var main = function() {
console.log('my code here');
};
if (!module.parent)
exports = main;
else
main();
var URL = 'https://status.heroku.com/api/v3/';
var UI = require('ui');
var ajax = require('ajax');
var main = new UI.Card({
title: 'Heroku Status',
body: 'Fetching...',
titleColor: 'purple',
});
def log_db_action
DB.loggers << Logger.new($stdout)
yield
DB.loggers = []
end
@jmervine
jmervine / main.go
Last active December 3, 2015 22:53
request something over and over
package main
import (
"flag"
"fmt"
"net/http"
"os"
"runtime"
"sync"
"time"