Clone into $GOPATH
and run:
git clone https://gist.github.com/fb3eb8e804cfbf9e1b7d.git repro
cd repro
go build
./repro
git checkout feature-branch
# empty commit; don't worry, this will not show up in the final pull
git commit --allow-empty -m "Empty commit"
git push origin feature-branch
# hard reset to before empty commit
git reset --hard HEAD~
git push -f origin feature-branch
require "json" | |
require "time" | |
# | |
# usage: releases.rb <app> | |
# | |
def get_releases(app) | |
# use curl for -n | |
JSON.parse(`curl --silent -n -H "Accept: application/vnd.heroku+json; version=3" -H "Range: seq ..; order=desc, max=1000" https://api.heroku.com/apps/#{app}/releases`) |
gem install oauth
irb
consumer = ::OAuth::Consumer.new(
"OAUTH_KEY",
"OAUTH_SECRET",
:site=>"https://www.readability.com/",
Developing applications against foreign services like the Heroku Platform API can unlock a powerful set of otherwise unavailable features, but can come with drawbacks: development must occur online, valid credentials are required, calls your code makes will reveal and manipulate real data, and API calls in tests have to stubbed out individually.
This article will offer a short overview on how these pain points can be
Go to your applications. Create a new one, and find the values in the Consumer Key and Consumer Secret fields.
Use OAuth client information to produce an OAuth 2 access token:
curl -i --user <consumer_key>:<consumer_secret> -X POST https://api.twitter.com/oauth2/token -d "grant_type=client_credentials"
{"access_token":"<oauth2_token>","token_type":"bearer"}%
# ab -n 1000 -c 10 -A :xxx https://api.brandur.herokudev.com/apps | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking api.brandur.herokudev.com (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |