Skip to content

Instantly share code, notes, and snippets.

View cuibonobo's full-sized avatar

Jen Garcia cuibonobo

View GitHub Profile
@cuibonobo
cuibonobo / google-spreadsheet.py
Created January 30, 2014 04:18
Quick Google spreadsheet setup
from google_spreadsheet.api import SpreadsheetOAuth
import os
ID_FIELD = '__rowid__'
client_secret = os.path.join('instance','client_secret.json')
api = SpreadsheetOAuth(client_secret,
'https://spreadsheets.google.com/feeds/',
'http://127.0.0.1:5000/oauth2callback',
'Floyd County Data')
@cuibonobo
cuibonobo / canvas-to-image.js
Created February 3, 2014 14:57
Convert HTML5 `canvas` elements to an image. Taken from http://davidwalsh.name/convert-canvas-image
// Converts image to canvas; returns new canvas element
function convertImageToCanvas(image) {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
canvas.getContext("2d").drawImage(image, 0, 0);
return canvas;
}

Per-Type Adapter Hooks

Requirements

Many existing JSON APIs are not consistent between types. As JSON endpoints grew organically and were built by different engineers at different times, the style in which records are represented can vary wildly.

Historically, we have asked adapter authors to rely on the fact that the type of record is provided to all adapter hooks (either by passing a type argument, or by passing a record

@cuibonobo
cuibonobo / Riot-js.md
Last active August 29, 2015 13:56
Riot.js helpers
@cuibonobo
cuibonobo / screen-vs-real.md
Last active August 29, 2015 13:56
Screen vs real-world measurements

If I place a sheet of 8" x 11" letter paper on the screen, what pixels/inch value does an on-screen document with the same dimensions need to have so that the document and the paper line up perfectly at 100% zoom?

Display pixels per inch
Cintiq 21 UX 94
@cuibonobo
cuibonobo / keybase.md
Created February 20, 2014 03:53
Keybase proof of identity for GitHub

Keybase proof

I hereby claim:

  • I am jenmontes on github.
  • I am jenmontes (https://keybase.io/jenmontes) on keybase.
  • I have the public key with fingerprint A03B 33D8 A876 DD8C F36D  AA06 C83E 1799 EEF6 1A91

To claim this, I am signing this object:

@cuibonobo
cuibonobo / Windows.md
Created February 22, 2014 18:55
Windows setup
@cuibonobo
cuibonobo / login-security.md
Last active August 29, 2015 13:57
How to secure a REST API
@cuibonobo
cuibonobo / sippets.md
Created March 12, 2014 23:36
Useful Javascript stuff. Sadly, a lot of these libraries are pretty big and have stuff that we don't need.
@cuibonobo
cuibonobo / python-memory.md
Last active August 29, 2015 13:57
Checking the memory usage of a python application