Skip to content

Instantly share code, notes, and snippets.

View gouldingken's full-sized avatar

Ken Goulding gouldingken

View GitHub Profile
@gouldingken
gouldingken / pnpm-post.js
Created December 1, 2022 21:30
Workaround for pnpm global link bug
const fs = require('fs');
const path = require("path");
const runScript = (script) => {
const child_process = require('child_process');
child_process.execSync(script, {stdio: [0, 1, 2]});
};
const processDir = async (dir) => {
let files = await fs.promises.readdir(dir, {withFileTypes: true});
import {
Group,
Mesh,
MeshNormalMaterial,
Loader,
SmoothShading
} from 'three';
import ViewerObjectLoader from "../../speckle-objects/modules/ViewerObjectLoader";
class SpeckleLoader extends Loader {
{
"name": "root",
"children": [
{
"name": null,
"children": [
{
"name": "",
"value": 137669
},
@gouldingken
gouldingken / coarseClusters.js
Created May 25, 2016 16:49
Simpler way to handle hierarchical clusters in ngraph.louvain
var modularity = require('../../');//require('ngraph.louvain');
var coarsen = require('ngraph.coarsen');
module.exports = function (graph, maxDepth) {
var clusters = modularity(graph);
var clustersByLevel = [];
maxDepth = maxDepth || 5;
@gouldingken
gouldingken / Readme.md
Last active August 6, 2020 06:27
square pack to fill any SVG shape
@gouldingken
gouldingken / Readme.md
Last active January 12, 2023 19:03
circle pack to fill any SVG shape
@gouldingken
gouldingken / nodesubdomains
Last active December 15, 2015 09:19
Node.js routing subdomains to folders with node-static
var _subServants = {};
var _addSubdomainDir = function (subdomain, relativePath) {
var cliPath = path.resolve(__dirname, relativePath);
_subServants[subdomain] = new (nodeStatic.Server)(cliPath);
};
var _init = function () {
_addSubdomainDir('brown', 'client/branches/brown');
_addSubdomainDir('green', 'client/branches/green');
@gouldingken
gouldingken / gist:3994831
Created November 1, 2012 16:26
Nodejitsu crowdgauge deploy
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy the app
error:
error: Rackspace Error (404): Item not found
error: Error output from Haibu:
error:
error: Error: Rackspace Error (404): Item not found
error: at Request._callback (/root/haibu-orchestra/node_modules/haibu/node
_modules/cloudfiles/lib/cloudfiles/common.js:184:18)
@gouldingken
gouldingken / index.html
Created March 30, 2012 16:11 — forked from mbostock/.block
Polymaps + D3.layout.pie
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.5"></script>
<script type="text/javascript" src="http://polymaps.org/polymaps.min.js?2.5.0"></script>
<style type="text/css">
@import url("http://polymaps.org/style.css");
html, body {