Skip to content

Instantly share code, notes, and snippets.

View beriberikix's full-sized avatar
🐶
I have no idea what I'm doing

Jonathan Beri beriberikix

🐶
I have no idea what I'm doing
View GitHub Profile
@beriberikix
beriberikix / index.js
Created February 28, 2015 19:20
Testing raspi-io
var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
io: new raspi()
});
board.on('ready', function() {
var on = new five.Pin(8);
});
@beriberikix
beriberikix / led_variable_light.ino
Created July 23, 2014 05:35
Hacky Arduino LED strip controller with 3 light modes - off, low and high
// stolen from the official debounce sample
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 11; // the number of the LED pin
// Variables will change:
int ledState = 0; // the current state of the output pin
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@beriberikix
beriberikix / equipmentlist.md
Created April 17, 2014 06:15
Uber list of apartment workbench equipemtn
Item Link Unit Price
foo bar baz
@beriberikix
beriberikix / index.html
Last active January 1, 2016 23:09
Sample showing Google+ Sign-In, the Google Picker & Google Drive API.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- you can move signIn() configs into meta tags.
See https://developers.google.com/+/web/signin/reference#page-level_configuration_options -->
<title>Drive Picker & API Sample</title>
</head>
<body>
@beriberikix
beriberikix / fullstack architecture diagram
Last active December 29, 2015 16:19
What does "Fullstack" mean for JS developers? Here's a stab at a crude architecture of decisions. Products and services are far from exhaustive and are only examples.
[ Scaling, nginx/ec2 auto scaling ][ Monitoring, dtrace/new relic ][ Logging, splunk/loggly ]
> [ Deployment, Chef ]
[ Frontend MV*, backbone/angular/ember ][ Visuals, bootstrap/foundation ]
[ Server framework, express, meteor ][ Templating, ejs/jade ][ Layout/styling, Sass ]
[ Language, Node.js/java/ruby ][ Persistance, mongo/mysql ][ Cache, memcache/redis ]
[ OS/container, mac/docker/vsphere ][ IaaS/PaaS/hosting, amazon/nodejitsu/digital ocean ]
@beriberikix
beriberikix / gist:6096633
Created July 27, 2013 23:02
j5 error on repl
string_decoder.js:109
charStr += buffer.toString(this.encoding, 0, end);
^
RangeError: toString() radix argument must be between 2 and 36
at Number.toString (native)
at StringDecoder.write (string_decoder.js:109:21)
at ReadStream.onData (readline.js:839:39)
at ReadStream.EventEmitter.emit (events.js:117:20)
at Board.<anonymous> (/Users/jberi/Desktop/node_modules/johnny-five/lib/board.js:284:27)
at Board.<anonymous> (/Users/jberi/Desktop/node_modules/johnny-five/lib/board.js:131:18)
@beriberikix
beriberikix / plus-plusone.html
Last active December 18, 2015 10:10 — forked from sjmiles/gist:5763113
Polymer/web components with async loading.
<element name="plus-plusone">
<script>
Polymer.register(this, {
ready: function() {
addInstance(this);
},
plusOneReady: function() {
// do stuff
console.log('plusone.js is ready');
}
@beriberikix
beriberikix / gist:3494858
Created August 28, 2012 04:03
Errors uploading firmata 2.2
In file included from StandardFirmata.cpp:19:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:80: error: typedef 'callbackFunction' is initialized (use __typeof__ instead)
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:80: error: 'byte' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:80: error: expected primary-expression before 'int'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:83: error: typedef 'sysexCallbackFunction' is initialized (use __typeof__ instead)
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:83: error: 'byte' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:83: error: 'byte' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Firmata.h:83: error: 'byte' was not declared in this scope
/Applications/Arduino.a
@beriberikix
beriberikix / gist:3058263
Created July 6, 2012 05:27
css jison file error
// used https://github.com/MarkBennett/css-smasher/blob/master/lib/parser.jison
//latest node stable and all packages
jison parser.jison -o cssParser.js -m js
// in the browser
<script src="cssParser.js"></script>
<script>
cssParser.parse("body { color: red; }");
</script>