Skip to content

Instantly share code, notes, and snippets.

#include <stdint.h>
#include <stdbool.h>
#include "gpio_api.h"
#include "timer.h"
#include "wait.h"
#include "matrix.h"
#ifndef DEBOUNCE
#define DEBOUNCE 5
@tybenz
tybenz / test.js
Created January 14, 2015 15:52
Better call-n-times
function range(val) {
var arr = [];
for (var i = 0; i < val; i++) {
arr.push(i);
}
return arr;
}
function logAndReturn() {
console.log('foo');
### Keybase proof
I hereby claim:
* I am tybenz on github.
* I am tybenz (https://keybase.io/tybenz) on keybase.
* I have a public key whose fingerprint is 42BF 9F22 838F 09CF E7C7 8933 EAE0 94DA 0A5E C1FA
To claim this, I am signing this object:
Error detected while processing function lightline#link:
line 1:
E716: Key not present in Dictionary: _mode_, mode(), 'normal')
Press ENTER or type command to continue
Error detected while processing function lightline#link:
line 1:
E116: Invalid arguments for function get(g:lightline._mode_, mode(), 'normal')
Press ENTER or type command to continue
Error detected while processing function lightline#link:
line 1:

Image Upload to S3

url: https://localhost:8083/api/v0/uploadImage
type: POST
Data: { ids: { id: <issue_id>, publication_id: <publication_id>, image_id: <image_uuid> }, file: <image file> }
returns: { result: true/false, publishedURL, error }

Publish

url: https://localhost:8083/api/v0/publish
{
"id": 387,
"publication_id": 154,
"title": "Eastern Cottontails",
"subtitle": "By H Cagle 9.26.12",
"pages": [
{
"id": 1068,
"issue_id": 387,
"type": "sections",
{
"requireCurlyBraces": [ "if", "else", "for", "while", "do" ],
"requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return" ],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowMultipleVarDecl": true,
@tybenz
tybenz / app.js
Last active August 29, 2015 14:02
Restify app **after** paper-router. Read comments below to get an idea of how it works.
var restify = require('restify');
var PaperRouter = require( 'paper-router' );
var routes = require( './routes' );
var server = restify.createServer({
name: 'luca',
});
server.use( function crossOrigin( req, res, next ) {
res.header( "Access-Control-Allow-Origin", "*" );
var BananaModel = require( '../models/banana.js' );
var BananaController = {
index: function( req, res, next ) {
res.send( BananaModel.getAll() );
}
create: function( req, res, next ) {
var banana = BananaModel.new({
weight: req.params.weight,
@tybenz
tybenz / app.js
Last active August 29, 2015 14:02
Restify app **before** paper-router. The typical way node server-side apps are written. Single file JS file with server setup and route/action bindings all in one place.
var restify = require('restify');
var BananaModel = require( './models/banana.js' );
var PeelModel = require( './models/peel.js' );
var server = restify.createServer({
name: 'luca',
});
server.use( function crossOrigin( req, res, next ) {
res.header( "Access-Control-Allow-Origin", "*" );