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 isFunction = fn => fn && Object.prototype.toString.call(fn) === '[object Function]'; | |
const isAsync = fn => fn && Object.prototype.toString.call(fn) === '[object AsyncFunction]'; | |
const isPromise = p => p && Object.prototype.toString.call(p) === '[object Promise]'; | |
const tap = f => x => { | |
f(x); | |
return x; | |
}; |
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
/** | |
* Performs right-to-left composition, combining multiple functions into a single function. | |
* @function compose | |
* @param {...Function} args | |
* @returns {Function} | |
*/ | |
const compose = (...fns) => x => fns.reduceRight((output, fn) => fn(output), x, fns); | |
/** | |
* Performs left-to-right composition, combining multiple functions into a single function. Sometimes called `sequence`. Right-to-left composition is typically known as `compose`. |
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 LinkedListNode { | |
constructor(value, next) { | |
this.value = value; | |
this.next = next || null; | |
} | |
} | |
class LinkedList { | |
constructor(value) { | |
this.size = 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
const cvs = document.querySelector('canvas'); | |
const c = cvs.getContext('2d'); | |
cvs.width = window.innerWidth; | |
cvs.height = window.innerHeight; | |
window.addEventListener('resize', function () { | |
cvs.width = window.innerWidth; | |
cvs.height = window.innerHeight; | |
}); |
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 cvs = document.querySelector('canvas'); | |
const c = cvs.getContext('2d'); | |
cvs.width = window.innerWidth; | |
cvs.height = window.innerHeight; | |
window.addEventListener('resize', function () { | |
cvs.width = window.innerWidth; | |
cvs.height = window.innerHeight; | |
}); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Canvas</title> |
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 cvs = document.querySelector('canvas'); | |
const c = cvs.getContext('2d'); | |
cvs.width = window.innerWidth; | |
cvs.height = window.innerHeight; | |
window.addEventListener('resize', function () { | |
cvs.width = window.innerWidth; | |
cvs.height = window.innerHeight; | |
}); |
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 dependencies | |
import * as THREE from 'three'; | |
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; | |
// Create Scene | |
const scene = new THREE.Scene(); | |
scene.background = new THREE.Color(0x282c34); | |
// Define a camera, set it to fill the browser window and position it | |
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 10000); |
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 { | |
BufferAttribute, | |
BufferGeometry, | |
Float32BufferAttribute, | |
LoaderUtils, | |
Vector3 | |
} from "three"; | |
export default function parseSTL ( data ) { |
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
{ | |
"name": "my-npm-package", | |
"version": "1.0.0", | |
"description": "An example package for a tutorial.", | |
"keywords": [ | |
"example", | |
"package", | |
"tutorial" | |
], | |
"homepage": "https://github.com/UserName/package-name", |