Skip to content

Instantly share code, notes, and snippets.

View PauloVBettio's full-sized avatar
🦜

Paulo Vinícius Bettio PauloVBettio

🦜
View GitHub Profile
@jebarjonet
jebarjonet / readingTime.js
Last active October 9, 2023 04:34
Time needed for a human to read a text (in ms)
import { max, words } from 'lodash'
export const readingTime = (text) => {
const wordsPerMinute = 280
const computedTime = (words(text).length * 60000) / wordsPerMinute
return max([2000, computedTime])
}
@Vercidium
Vercidium / greedyvoxelmeshing
Last active June 10, 2024 12:21
Greedy Voxel Meshing ported to C#
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implementation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)