Skip to content

Instantly share code, notes, and snippets.

View elifitch's full-sized avatar
😬

Eli Fitch elifitch

😬
View GitHub Profile

procedural mesh generation

Generates an algorithmic 3D OBJ file with ThreeJS and Node.js.

# print to stdout
node generate-mesh.js > test.obj

# write to file
node generate-mesh.js test.obj
@lucdew
lucdew / json_postgres.js
Last active April 12, 2025 09:09
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
function asyncFunction (param) {
// Scope local variables to this function
// param is also both locally scoped
var n = param.name
var e = param.extension
// Simulate something asynchronous happening
setTimeout(function(){
console.log("Downloaded file: " + n + "." + e)
}, 500 + (Math.random() * 500))