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
The MIT License (MIT) | |
Copyright (c) 2014 TODO | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
/* | |
Bean Loader v 1.9.3 build 1219 | |
Arduino v 1.6.5 | |
previous problem: | |
when I input via D5 using a reed switch (cyclometer head+mount) | |
and smack the sensor with a magnet it often increments by a step of 5 or so, | |
so too much suggesting the interrupt occurs several times instead of the expected single hit | |
for that pass of the magnet by the reed switch |
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
// paulirish, emoller et al. MIT license | |
window.requestAnimationFrame = window.requestAnimationFrame || function(callback, element){ | |
var fn, cfn, w = window, lastTime = 0, v, vendors = 'webkit,moz,ms,o'.split(','); | |
while(!fn && (v = vendors.shift())){ | |
fn = w[v+'RequestAnimationFrame']; | |
cfn = w[v+'CancelAnimationFrame'] || w[v+'CancelRequestAnimationFrame']; | |
}; | |
w.requestAnimationFrame = fn || function(callback, element){ | |
var id, currTime = new Date().getTime(), timeToCall = Math.max(0, 16 - (currTime - lastTime)); |
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 styleRulesFor(elementList){ | |
var el, i, out = [], allRules, getMatchedCSSRules, getComputedStyle = window.getComputedStyle; | |
if(!(getMatchedCSSRules=window.getMatchedCSSRules)){ | |
// this is very slow | |
allRules = function(){ | |
// setup when needed | |
var rules = [], i = 0, sheet, styleSheets = el.ownerDocument.styleSheets; | |
while(sheet = styleSheets[i++]){ | |
rules.push.apply(rules, sheet.rules||[]); | |
}; |
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
/* | |
based on https://gist.github.com/bwdolphin/e7de2d0a21914708bd9a | |
setup: | |
open /Applications/Utilities/Script Editor | |
edit and save | |
System Prefs > Security & Privacy > [Privacy tab] > Accessibility in left sidebar | |
-> add [+] this new app (NOTE must repeat this addition every time the app/script is saved/changed to avoid security errrors) | |
run (eg in the terminal): | |
% cordova run ios && open ./path/to/debugiOS.app/ |
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 unthrottle(it){ | |
cancelAnimationFrame(it.index); | |
it.node.removeEventListener(it.type, it.throttle); | |
return it; | |
} | |
/** | |
* @param {object} it defines what to throttle, requires 3 properties: | |
* @param {string} it.type event name | |
* @param {Node} it.node DOM element |
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
// work with angular since Batarang is giving me problems | |
(function(){ | |
function $scope($0){ $0 = angular.element( | |
typeof($0) === 'string' ? document.querySelectorAll($0) : $0 | |
).scope(); $scope.$0 = $0; return $scope; } | |
window.$scope = $scope; | |
console.log('window.$scope($0) returns scope for element $0',$scope(document)); | |
})(); | |
// $http for convenient http requests | |
(function(){ |
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
/* this last updated 2016 Dec 9 | |
v1 available: | |
2016 Nov in WebKit, Safari Tech Preview | |
2016 Chrome 54 | |
curious when this lands on ios/macos | |
Chrome devtools show shadow DOM by default | |
Safari devtools must enable it in elements by selecting the icon |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 1 column, instead of 4. in line 5.
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
# WARNING | |
# UNCOMFIRMED VALUES | |
# USE AT YOUR OWN RISK | |
# Suzuki sv650s TIGHTENING TORQUE | |
# ENGINE | |
ITEM N-m kgf-m lb-ft | |
Cylinder head cover bolt 14 1.40 10.0 | |
Spark plug 11 1.10 8.0 | |
Camshaft journal holder bolt 10 1.00 7.0 |
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
authoritative sources: | |
https://github.com/nodejs/node/wiki | |
https://nodejs.org/en/security/ | |
https://nodejs.org/ | |
https://nodejs.org/en/docs/ | |
TODO (arguably) the wiki could use more material currently spread across the internet | |
injection/input escaping: | |
TODO what are the modules/strategies necessary for managing input that moves through the application |