This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Keyboard.h> | |
const int PEDAL_PIN = 2; | |
int pedalVal = LOW; | |
char keyToSend = 'm'; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(PEDAL_PIN, INPUT); | |
Keyboard.begin(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
"devDependencies": { | |
"babel-preset-es2015": "~6.6.0", | |
"babel-preset-react": "~6.5.0", | |
"babelify": "~7.2.0", | |
"browserify": "~4.2.0", | |
"gulp": "~3.9.0", | |
"gulp-notify": "~1.4.0", | |
"gulp-util": "~2.2.19", | |
"react": "~0.14.8", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getURLParameter = function(name) { | |
var valStr = decodeURIComponent( (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[0,null])[1]); | |
return valStr === 'null' ? null : valStr; | |
}; | |
// url param map | |
var urlParams = location.search.substr(1).split('&').reduce(function(map, item) { | |
item = item.split('='); | |
map[item[0]] = item[1]; | |
return map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gpio = require('gpio'); | |
var header4, header17, intervalTimer; | |
header4 = gpio.export(4); | |
header17 = gpio.export(17, { | |
ready: function() { | |
intervalTimer = setInterval(function() { | |
header4.set(); | |
setTimeout(function() { header4.reset(); }, 500); | |
}, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// capture x.x portion and store as a number, returns NaN if not IE | |
var IE = /MSIE (\d+\.\d+);/.test(navigator.userAgent) ? parseFloat(RegExp.$1) : NaN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
# Displays git branch next to directory path | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* An implementation of the interface system in Javascript that takes a design form | |
similar to other popular object-oriented languages such as Java, C# and PHP. */ | |
Function.prototype.implements = function(){ | |
var class = this; | |
if(arguments.length < 1) { | |
throw new Error("Expecting interface as argument but found none."); | |
} | |
for (var i =0; i<arguments.length; i++){ |