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
// import { Machine, send } from 'xstate'; | |
//---------------------------------------- | |
const findingDevice = { | |
initial: 'findingDevice', | |
states: { | |
/* BASE STATES */ | |
foundDevice: { | |
type: 'final', |
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
// import { Machine, send } from 'xstate'; | |
//---------------------------------------- | |
const findingDevice = { | |
initial: 'findingDevice', | |
states: { | |
/* BASE STATES */ | |
foundDevice: { | |
type: 'final', |
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
//---------------------------------------- | |
const findingDevice = { |
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
// const initDevice = { | |
// initial: 'readingServices', | |
// states: { | |
// readingServices: { | |
// on: { | |
// BT_READING_DEVICE_STATE: 'readingDeviceState', | |
// BT_DEVICE_READ_ERROR: 'readTimeout' | |
// } | |
// }, | |
// readingDeviceState: { |
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
// Restricts a number to the minimum/maximum | |
function clamp(value, min, max) { | |
return Math.min(max, Math.max(min, value)); | |
} | |
// Linear interpolation | |
function lerp(value, min, max) { | |
return min * (1 - value) + max * value; | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am benatwork on github. | |
* I am b3nroth (https://keybase.io/b3nroth) on keybase. | |
* I have a public key ASB9OoIlPCq5vOw3DODbsAsyTMDOlsfI37qCSISyedSpNwo | |
To claim this, I am signing this object: |
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 Twitalinkahashifyer! | |
* http://www.dustindiaz.com/basement/ify.html | |
* Eg: | |
* ify.clean('your tweet text'); | |
*/ | |
ify: { | |
link: function(tweet) { | |
return tweet.replace(/\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g, function(link, m1, m2, m3, m4) { | |
var http = m2.match(/w/) ? 'http://' : ''; |
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 roundToIncrement(originalNumber,increment) { | |
return Math.round( originalNumber / increment ) * increment; | |
} |
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
for f in *.mov; do ffmpeg -y -i "$f" -f image2 -ss 10 -vframes 1 -an "${f%.mov}.jpg"; done |
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
/* | |
YouTube Footer Buttons | |
*/ | |
.button { | |
border: 1px solid #DDD; | |
border-radius: 3px; | |
text-shadow: 0 1px 1px white; | |
box-shadow: 0 1px 1px #fff; | |
font: bold 11px Sans-Serif; |
NewerOlder