This file contains hidden or 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
<mm-keyboard oscillator-type="sawtooth"> | |
<mm-key class-name="white b" frequency="174.614" time="1"></mm-key> | |
<mm-key class-name="black as" frequency="184.997" time="1"></mm-key> | |
<mm-key class-name="white a" frequency="195.998" time="1"></mm-key> | |
<mm-key class-name="black gs" frequency="200.000" time="1"></mm-key> | |
<mm-key class-name="white g" frequency="207.652" time="1"></mm-key> | |
<mm-key class-name="black fs" frequency="233.082" time="1"></mm-key> | |
<mm-key class-name="white f" frequency="246.942" time="1"></mm-key> | |
<mm-key class-name="white e" frequency="261.626" time="1"></mm-key> <!-- Middle c --> | |
<mm-key class-name="black ds" frequency="277.183" time="1"></mm-key> |
This file contains hidden or 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 e = document.createDocumentFragment('div'); | |
const sleep = (ms, caller, ...args) => new Promise(resolve => setTimeout(caller || resolve, ms, ...args)); | |
const waitForHello = async(timeout, elm) => { | |
console.log('checking'); | |
if (elm.innerHTML === 'Hello world') { | |
console.log('Value found'); | |
return; | |
} else if ((timeout -= 100) <= 0) { |
This file contains hidden or 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 sleep = (ms, caller, ...args) => new Promise(resolve => setTimeout(caller || resolve, ms, ...args)); |
This file contains hidden or 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 sleep = ms => { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} |
This file contains hidden or 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 register = shared => ({ | |
event: 'HeatWarning', | |
command: async event => { | |
const lights = await shared.hub.lights.getAll(); | |
lights.map(async (light, index) => { | |
light.on = true; | |
light.alert = 'lselect'; | |
light.effect = 'none'; | |
light.brightness = 254; |
This file contains hidden or 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
[ | |
{ "timestamp":"2017-11-06T17:41:47Z", "event":"Loadout", "Ship":"DiamondBackXL"}, | |
{ "timestamp":"2017-11-06T17:43:01Z", "event":"StartJump", "JumpType":"Hyperspace", "StarSystem":"Sol", "StarClass":"G" }, | |
{ "timestamp":"2017-11-06T17:47:57Z", "event":"HeatWarning" } | |
] |
This file contains hidden or 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
# Given a version returned of 1.2.3-beta.0 from the package I only want the "1.2.3" part | |
grep -m1 version package.json | awk -F: '{ print $2 }' | sed 's/[^0-9.].*//g' | |
# Running the above command I get an empty output. But if I manually run the result: | |
echo "1.2.3-beta.0", | sed 's/[^0-9.].*//g' | |
# I get 1.2.3 |
This file contains hidden or 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 BitlyClient = require('bitly'); | |
const bitly = BitleyClient('<accessToken>'); | |
const uri = 'https://github.com/tanepiper/node-bitly'; | |
bitly.shorten(uri).then(result => { | |
console.log(result); | |
}); |
This file contains hidden or 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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"module": "commonjs", | |
"lib": ["es7"], | |
"allowJs": true, | |
"strict": false, | |
"noImplicitAny": false, | |
"strictNullChecks": false, | |
"noUnusedLocals": true, |
This file contains hidden or 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 doRequest = async ({ accessToken, config, method, data }) => { | |
const uri = generateUrl(accessToken, method, data, config); | |
try { | |
const req = await request({ uri }); | |
return JSON.parse(req); | |
} catch (e) { | |
console.log('Request Failed'); | |
throw e; | |
} | |
}; |