Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mpguerra on github.
  • I am mpguerra (https://keybase.io/mpguerra) on keybase.
  • I have a public key whose fingerprint is 3E7F A89E 2459 B6CC A62F 56B8 C6CB 772E F096 9C45

To claim this, I am signing this object:

@mpguerra
mpguerra / Signup Express
Created May 7, 2015 12:59
Call to Signup Express Method
curl -v -X POST "https://sendgrid-admin.3scale.net/admin/api/signup.xml" -d 'provider_key=PROVIDER_KEY&org_name=COMPANY_NAME&username=USERNAME&email=EMAIL&password=PASSWORD&application_plan_id=MONTHLY_PLAN_ID'
@mpguerra
mpguerra / favicon
Created April 7, 2015 13:39
Adding a favicon to 3scale hosted developer portal
<!-- Favicon -->
<link rel="shortcut icon" href="/images/icon.ico" type="image/x-icon" />
@mpguerra
mpguerra / connect_redis
Created October 28, 2014 10:32
Connecting to redistogo instance on Heroku from lua
function M.connect_redis(red)
redisurl = os.getenv("REDISTOGO_URL")
redisurl_connect = string.split(redisurl, ":")[3]
redisurl_user = string.split(redisurl_connect, "@")[1]
redisurl_host = string.split(redisurl_connect, "@")[2]
redisurl_port = tonumber(string.split(redisurl, ":")[4])
local ok, err = red:connect(redisurl_host, redisurl_port)
if not ok then
ngx.say("failed to connect: ", err)
@mpguerra
mpguerra / 3scaleWorkshop.md
Last active August 29, 2015 14:06
Steps and links for 3scale Workshop: Crash Course - Practical API Management
@mpguerra
mpguerra / ADIncludeScript.html
Created February 13, 2014 12:01
Script to include Active Docs in the 3scale Developer Portal in a given order.
<script>
$(function(){
ThreeScale.APIDocs.init(['oauth','sentiment']);
});
</script>
@mpguerra
mpguerra / XFrameOptions.rb
Created February 13, 2014 11:46
Setting Cross Frame Options in Ruby
config.action_dispatch.default_headers['X-Frame-Options'] = "ALLOW-FROM https://developers.google.com/oauthplayground"
@mpguerra
mpguerra / ADSpecOAuthSentimentAPI.json
Last active August 29, 2015 13:56
A sample Active Docs Spec for an OAuth enabled Sentiment API
{
"basePath": "http://sentiment-api.herokuapp.com",
"apiVersion": "v1",
"apis": [
{
"path": "/v1/words/{word}.json",
"operations": [
{
"httpMethod": "GET",
"summary": "Returns the sentiment value of a given word",
@mpguerra
mpguerra / GoogleOAuthPlaygroundServerSideIframeLink.html
Created February 13, 2014 11:26
An Iframe link to the Google OAuth Developer Playground for a Server-Side Web Applications Flow. In a 3scale Powered Developer portal, the client_id and client_secret values are populated for a signed in users using liquid tags.
@mpguerra
mpguerra / GoogleOAuthPlaygroundClientSideIframeLink.html
Created February 13, 2014 11:25
An Iframe link to the Google OAuth Developer Playground for a Client-Side Web Applications Flow. In a 3scale Powered Developer portal, the client_id and client_secret values are populated for a signed in users using liquid tags.