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
function ledStripMap(cols, rows) { | |
var total = cols * rows; | |
// var map | |
var map = new Uint8Array(total); | |
var index = 0; | |
var count = 0 | |
for(var i = 0; i < cols; i++) { | |
for (var j = 0; j < rows; j++) { | |
if (i % 2 === 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
drawRaycastLine(raycaster) { | |
let material = new THREE.LineBasicMaterial({ | |
color: 0xff0000, | |
linewidth: 10 | |
}); | |
let geometry = new THREE.Geometry(); | |
let startVec = new THREE.Vector3( | |
raycaster.ray.origin.x, | |
raycaster.ray.origin.y, | |
raycaster.ray.origin.z); |
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
function addQuotes(match) { | |
return '"' + match.substr(0, match.length-1) + '":'; | |
} | |
var t = "{tags:['000000000000000000000004', '000000000000000000000003', '300833B2DDD9014000000024', '300833B2DDD9014000000045', '300833B2DDD9014000000021', '000000000000000000000005', '000000000000000000000001', '300833B2DDD9014000000022', '000000000000000000000002']}"; | |
var k = t.replace(/\'/g, '"'); | |
k.replace(/[a-z]*\:/g, addQuotes); | |
/* | |
output: |
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 spawn = require('child_process').spawn; | |
// open default browser | |
spawn('open', ['http://localhost:9000']); | |
console.log('running on http://localhost:9000'); |
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
{ | |
"browser": true, | |
"node": true, | |
"esnext": true, | |
"bitwise": true, | |
"camelcase": true, | |
"curly": false, | |
"eqeqeq": true, | |
"immed": true, | |
"indent": 2, |
NewerOlder