Skip to content

Instantly share code, notes, and snippets.

Tyler Benziger tybenz

Block or report user

Report or block tybenz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View matrix.c
#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 Jan 14, 2015
Better call-n-times
View test.js
function range(val) {
var arr = [];
for (var i = 0; i < val; i++) {
arr.push(i);
}
return arr;
}
function logAndReturn() {
console.log('foo');
View gist:8bc9e06830f912b83fb3
### 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:
View gist:d62700e96ac8f5f24038
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:
View README.md

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
View test.js
{
"id": 387,
"publication_id": 154,
"title": "Eastern Cottontails",
"subtitle": "By H Cagle 9.26.12",
"pages": [
{
"id": 1068,
"issue_id": 387,
"type": "sections",
View .jscs.json
{
"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 Aug 29, 2015
Restify app **after** paper-router. Read comments below to get an idea of how it works.
View app.js
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", "*" );
View bananaController.js
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 Aug 29, 2015
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.
View app.js
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", "*" );
You can’t perform that action at this time.