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
// To delete tweets, navigate to your Twitter/X profile, open your browser's JavaScript console, and paste the script below. | |
async function sleep(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)) | |
} | |
async function deleteTweets() { | |
const tweetsRemaining = document.querySelectorAll('[role="heading"]+div')[1].textContent; | |
console.log('Remaining: ', tweetsRemaining); | |
window.scrollBy(0, 10000); |
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
<div> | |
<script type="importmap"> | |
{ | |
"imports": { | |
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | |
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/" | |
} | |
} | |
</script> | |
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 { Document, NodeIO, Primitive } from '@gltf-transform/core'; | |
const document = new Document(); | |
const buffer = document.createBuffer(); | |
const position = document.createAccessor() | |
.setType('VEC3') | |
.setBuffer(buffer) | |
.setArray(new Float32Array([ | |
0, 0, 0, // ax,ay,az |
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
/** | |
* Various methods of estimating a vertex count. For some background on why | |
* multiple definitions of a vertex count should exist, see [_Vertex Count | |
* Higher in Engine than in 3D Software_](https://shahriyarshahrabi.medium.com/vertex-count-higher-in-engine-than-in-3d-software-badc348ada66). | |
* | |
* NOTICE: Many rendering features, such as volumetric transmission, may lead | |
* to additional passes over some or all vertices. Such tradeoffs are | |
* implementation-dependent, and not considered here. | |
*/ | |
export enum VertexCountMethod { |
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 {readFile} from 'node:fs/promises'; | |
import {join} from 'node:path'; | |
import glob from 'glob'; | |
import builtinModules from 'builtin-modules'; | |
const IMPORT_IDENTIFIER_REGEX = /(?:\A|\r|\n|\r\n)import[^'"]*['"]([\@\.\/\w_-]+)['"]/g; | |
const BUILTIN_MODULES = new Set<string>(builtinModules); | |
const pkgPaths = glob.sync(join('modules', '*', 'package.json')); |
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
#!/usr/bin/env bash | |
OCIO="/Applications/Blender 4.0.app/Contents/Resources/4.0/datafiles/colormanagement/config.ocio" | |
OCIO_LOOK="AgX - Base Contrast" | |
# Source: https://github.com/sobotka/Testing_Imagery | |
declare -a arr=( | |
"blue_bar_709" | |
"Matas_Alexa_Mini_sample_BT709" | |
"mery_lightSaber_lin_srgb" |
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 { Document, NodeIO } from '@gltf-transform/core'; | |
function createTorus(radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2) { | |
const indicesArray = []; | |
const positionArray = []; | |
const texcoordArray = []; | |
const vertex = [0, 0, 0]; | |
// generate positions and uvs |
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
#!/bin/bash | |
FILES="./path/to/models/*.glb" | |
for file in $FILES; do | |
echo "Compressing $file..." | |
gltf-transform draco "${file%.glb}.glb" "${file%.glb}-draco.glb" | |
done |
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 { NodeIO } from '@gltf-transform/core'; | |
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions'; | |
import draco3d from 'draco3dgltf'; | |
// set up I/O | |
const io = new NodeIO() | |
.registerExtensions(KHRONOS_EXTENSIONS) | |
.registerDependencies({'draco3d.decoder': await draco3d.createDecoderModule()}); | |
const document = await io.read('path/to/file.glb'); |
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 { Extension, ExtensionProperty, Node, NodeIO, PropertyType } from '@gltf-transform/core'; | |
import { weld, dedup, simplifyPrimitive } from '@gltf-transform/functions'; | |
import { MeshoptSimplifier } from 'meshoptimizer'; | |
/****************************************************************************** | |
* Example implementation of MSFT_lod for glTF-Transform. | |
* | |
* ⚠️ NOTICE: This code is provided for the sake of example, and is not tested or | |
* maintained. For a full implementation, refer to: | |
* https://github.com/takahirox/glTF-Transform-lod-script |
NewerOlder