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, |
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
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
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 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
/** | |
* @param {Array} arr - [140, 255, 1] | |
* @returns {Array} [0.5490196078, 1, 0.003921568627] | |
*/ | |
export function normalizeArray (arr, value) { | |
return arr.map(v => v / value) | |
} | |
/** | |
* @param {Number} colorNum 0xff00ff |
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
import { Application } from 'pixi.js' | |
const app = new Application({ | |
width: window.innerWidth, | |
height: window.innerHeight, | |
resolution: window.devicePixelRatio || 1, | |
antialias: true | |
}) | |
app.ticker.add(() => { |
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
export async function resizeImageData (imageData, width, height) { | |
const resizeWidth = width >> 0 | |
const resizeHeight = height >> 0 | |
const ibm = await window.createImageBitmap(imageData, 0, 0, imageData.width, imageData.height, { | |
resizeWidth, resizeHeight | |
}) | |
const canvas = document.createElement('canvas') | |
canvas.width = resizeWidth | |
canvas.height = resizeHeight | |
const ctx = canvas.getContext('2d') |
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
import { TweenMax } from 'gsap' | |
import 'gsap/ColorPropsPlugin' | |
const g = new Graphics() | |
g.beginFill(color, alpha) | |
g.drawRect(x, y, width, height) | |
g.endFill() | |
container.addChild(g) | |
TweenMax.to(g, 0.5, {colorProps: {tint: 0x00aaff, format: 'number'}}) |
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
[ | |
{ | |
"class": "sidebar_label", | |
"color": [131, 148, 150], | |
"font.bold": false, | |
"font.size": 16, | |
"font.face": "IBM Plex Mono" | |
}, | |
{ | |
"class": "sidebar_container", |
OlderNewer