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
$(window).resize(function() { | |
// window dimenstions | |
var windowWidth = $(window).width(); | |
var windowHeight = $(window).height(); | |
// figure dimensions | |
var figureWidth = $('#detailScreen figure').width(); | |
var figureHeight = $('#detailScreen figure').height(); |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 14, | |
// font family with optional fallbacks | |
fontFamily: '"Source Code Pro", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.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
for (let i = 1; i < artnetOptions.channels + 1; i++) { | |
console.log('status: switching on valve ' + i) | |
if (i > 1) artnet.set(i - 1, 0) | |
artnet.set(i, 255, function() { | |
// iterate | |
}) | |
} | |
artnet.close() |
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
[22143.845950] usb 2-6: new SuperSpeed USB device number 5 using xhci_hcd | |
[22143.859274] usb 2-6: New USB device found, idVendor=1058, idProduct=25a2 | |
[22143.859283] usb 2-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3 | |
[22143.859289] usb 2-6: Product: Elements 25A2 | |
[22143.859294] usb 2-6: Manufacturer: Western Digital | |
[22143.859299] usb 2-6: SerialNumber: 575839314139364438375546 |
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 {performance} = require('perf_hooks') | |
let lastTs, newTs | |
const desiredFps = 30.0 | |
const interval = () => { | |
lastTs = newTs | |
newTs = performance.now() | |
const err = newTs - lastTs - 1000.0 / desiredFps | |
const newDelay = 1000.0 / desiredFps - err | |
setTimeout(interval, newDelay) | |
} |
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
(async () => { | |
let response, configJson | |
try { | |
response = await fetch('./config.json') | |
configJson = await response.json() | |
} catch(error) { | |
configJson = { | |
"fallback": true | |
} | |
} |
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
{ | |
"name": "Switzerland", | |
"view": { | |
"zoom": 34, // changable by maptool | |
"lat": 46.7310679, // changable by maptool | |
"lon": 6.2670205 // changable by maptool | |
}, | |
"places": [ | |
{ | |
"type": "federation", |
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
// .js instead of .json for convenience | |
{ | |
"id": "string", | |
"original-loc": { | |
"lat": "double", | |
"lon": "double" | |
}, | |
"name": "string", | |
"tag": "string", | |
"country-code": "string", |
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.setState(state => { | |
view: { | |
...state.view, | |
lat: coords.lat, | |
lon: coords.lon | |
} | |
}) |
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 shifty = require('shifty') | |
console.log(shifty) | |
shifty.tween({ | |
from: { | |
x: 0 | |
}, to: { | |
x: 10 | |
}, step: state => console.log(state) | |
}).then(() => console.log('done')) |
OlderNewer