15 Custom Hooks to Make your React Component Lightweight JavaScript in Plain English on Medium
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 outputs coordinates of yaw/pitch on click | |
document.addEventListener('click', (e) => { | |
let view = viewer.view() | |
let x = e.clientX | |
let y = e.clientY | |
console.log(view.screenToCoordinates({ x, y })) | |
}) |
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
# find group of 10 chars (numbers and letters - lowercase) | |
(?:[0-9+a-z]{10})$ | |
ex: ja4xwjaen2 |
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
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all |
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 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 outputs coordinates of yaw/pitch on click | |
document.addEventListener("click", (e) => { | |
var view = viewer.view(); | |
let x = e.clientX; | |
let y = e.clientY; | |
console.log(view.screenToCoordinates({ x, y })); | |
}); | |
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
float threshold(float edge0, float edge1, float x) { | |
return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); | |
} | |
float hash(vec3 p) { | |
p = fract(p * 0.3183099 + .1); | |
p *= 17.0; | |
return fract(p.x * p.y * p.z * (p.x + p.y + p.z)); | |
} |
NewerOlder