Skip to content

Instantly share code, notes, and snippets.

View pedro's full-sized avatar

Pedro Belo pedro

  • San Francisco, CA
  • X @ped
View GitHub Profile

Describing APIs

  • Idea is to have a DSL/structured file that will describe your API

  • Question: is there a repo where people share their Blueprint schemas so we can see them?

    • Not right now. There are definitely plans to make it really open
    • Some people are already sharing their blueprints on GH
  • There are no other ways to collaborate on API design

Batch APIs

  • Common requirements

    • Are they atomic?
    • What kind of operations are supported?
  • Existing approaches

  • POST /batch

API testing and validation

  • Difference?
    • Validation: API receives a message and decides if it's valid or not
    • Testing: different use cases
      • TDD as you build the API
      • Test if the API is running (lifecycle/ci)
      • Debugging
    • API performance testing
"there are only two industries calling their customers users"
maps of cancer in the us - multivariables/prob 1k data points but not clutter
fix the clutter. Clutter is in the presentation, not in the data.
tables - espn has 500 numbers
have we suddenly got dumber because we got to work?
look at financial tables, weather tables, sports..
7 elements on a page? paper: the magic number 7

Pedro's Amazing Guide To Rooftop Bars

Drinking with a perspective

Very few people respect the art of rooftop drinking these days.

Notably, rooftop bar customers often believe that wearing a suit or a fancy dress conveys respect.

Niclekback wears suits

@pedro
pedro / rank-pulls.rb
Last active December 27, 2015 13:19
Quick hacky script to rank closed pull requests on a repo in hopes to answers "what happened last year?". Requires gems octokit and peach.
require "rubygems"
require "octokit"
require "peach"
# warning! this will make a crapton of requests under your account.
# you might want to review/tweak the values below, or disable
# auto_paginate to test things first.
# get an access token at https://github.com/settings/tokens/new
token = ENV["TOKEN"] || abort("missing TOKEN")
require "rubygems"
require "octokit"
# get an access token at https://github.com/settings/tokens/new
token = ENV["TOKEN"] || abort("missing TOKEN")
repo = ENV["REPO"] || abort("missing REPO. eg: pedro/devdigest")
client = Octokit::Client.new access_token: token
stats = Hash.new(0)

Given a stupid table:

# SELECT * FROM sample;
 id | foo | bar 
----+-----+-----
 10 | a   | a
 11 | a   | b
 12 | a   | b
 13 | a | c

Keybase proof

I hereby claim:

  • I am pedro on github.
  • I am ped (https://keybase.io/ped) on keybase.
  • I have a public key whose fingerprint is B3CB A84E 05B4 03FC 2506 BD8F ACF9 8F42 BA4D 4E90

To claim this, I am signing this object: