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 SHA256 = require("crypto-js/sha256"); | |
class CryptoBlock { | |
constructor(index, timestamp, data, precedingHash = " ") { | |
this.index = index; | |
this.timestamp = timestamp; | |
this.data = data; | |
this.precedingHash = precedingHash; | |
this.hash = this.computeHash(); | |
this.nonce = 0; | |
} |
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 { WebGLCubeRenderTarget, Camera, Scene, Mesh, PlaneBufferGeometry, ShaderMaterial, CubeRefractionMapping, BackSide, NoBlending, BoxBufferGeometry, CubeCamera } from 'three' | |
import { Vector2, MeshBasicMaterial, DoubleSide, RGBFormat, LinearFilter, CubeReflectionMapping, WebGLRenderTarget, EquirectangularReflectionMapping } from 'three/build/three.module' | |
import { cloneUniforms } from 'three/src/renderers/shaders/UniformsUtils.js' | |
class CustomWebGLCubeRenderTarget extends WebGLCubeRenderTarget { | |
constructor (width, height, options) { | |
super(width, height, options) | |
this.ok = true | |
} | |
setup (renderer, texture) { | |
this.texture.type = texture.type |
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 { WebGLCubeRenderTarget, Camera, Scene, Mesh, PlaneBufferGeometry, ShaderMaterial, CubeRefractionMapping, BackSide, NoBlending, BoxBufferGeometry, CubeCamera } from 'three' | |
import { Vector2, MeshBasicMaterial, DoubleSide, RGBFormat, LinearFilter, CubeReflectionMapping, WebGLRenderTarget, EquirectangularReflectionMapping } from 'three/build/three.module' | |
import { cloneUniforms } from 'three/src/renderers/shaders/UniformsUtils.js' | |
class CustomWebGLCubeRenderTarget extends WebGLCubeRenderTarget { | |
constructor (width, height, options) { | |
super(width, height, options) | |
this.ok = true | |
} | |
setup (renderer, texture) { | |
this.texture.type = texture.type |
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
// long version | |
function loadExt(files, after) { | |
var _this=this; | |
_this.files = files; | |
_this.js = []; | |
_this.head = document.getElementsByTagName("head")[0]; | |
_this.after = after || function(){}; | |
_this.loadStyle = function(file) { | |
var link = document.createElement("link"); | |
link.rel = "stylesheet"; |
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
<template> | |
<circle v-if="point" ref="control-point" @mousedown="onMD" class="cursor-move" :cx="point.x" :cy="point.y" r="15" fill="pink" /> | |
</template> | |
<script> | |
export default { | |
props: { | |
width: {}, | |
height: {}, | |
point: {}, |
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
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === 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
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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
<html> | |
<head> | |
<script src="clmtrackr.js"></script> | |
<script src="model_pca_20_svm.js"></script> | |
<script src="p5.js"></script> | |
<script src="p5.dom.js"></script> | |
<script> | |
var ctracker; |
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
// please load three js and also this | |
// https://threejs.org/examples/js/GPUComputationRenderer.js | |
var particleVelocityShader = ` | |
#include <common> | |
uniform vec2 mousePos; | |
float constrain(float val, float min, float max) { | |
if (val < min) { |
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 * as THREE from 'three' | |
import 'imports-loader?THREE=three!three/examples/js/postprocessing/EffectComposer.js' | |
import 'imports-loader?THREE=three!three/examples/js/postprocessing/RenderPass.js' | |
import 'imports-loader?THREE=three!three/examples/js/postprocessing/MaskPass.js' | |
import 'imports-loader?THREE=three!three/examples/js/postprocessing/ShaderPass.js' | |
import 'imports-loader?THREE=three!three/examples/js/shaders/CopyShader.js' | |
import 'imports-loader?THREE=three!three/examples/js/shaders/FXAAShader.js' | |
import 'imports-loader?THREE=three!three/examples/js/shaders/ConvolutionShader.js' | |
import 'imports-loader?THREE=three!three/examples/js/shaders/LuminosityHighPassShader.js' | |
import 'imports-loader?THREE=three!three/examples/js/postprocessing/UnrealBloomPass.js' |