Skip to content

Instantly share code, notes, and snippets.

View andrewmunro's full-sized avatar

Andrew Munro andrewmunro

View GitHub Profile
@andrewmunro
andrewmunro / mergeGeometries.ts
Created August 4, 2022 09:06
Merge threejs GLTF/GLB geometries
import { BufferGeometryUtils } from 'three/examples/jsm/utils/BufferGeometryUtils';
import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter';
import { BufferGeometry, getMesh, LoadGLTF, Material, Mesh, MeshBasicMaterial } from '@milk-ecs/three';
import { Blob, FileReader } from 'vblob';
import { writeFileSync } from 'fs';
// Some hacks to get GLTFExporter working in nodejs
global.window = global;
global.Blob = Blob;
global.FileReader = FileReader;
@andrewmunro
andrewmunro / Brewfile
Created January 26, 2022 18:29
Brewfile
cask_args appdir: "/Applications"
tap "homebrew/cask"
tap "homebrew/cask-versions"
brew "asciinema"
brew "chezmoi"
brew "ctop"
brew "dive"
brew "go"
brew "findutils"
@andrewmunro
andrewmunro / PhysxSystem.ts
Created July 28, 2020 10:42
Adding PhysxSystem
export class PhysxSystem extends System {
private physics: any;
private scene: any;
private bodies = [];
constructor() {
super();
const PhysX = physx({
locateFile(path) {
@andrewmunro
andrewmunro / build.sh
Created January 23, 2018 17:20
Maven Spigot Plugin Builder
#!/bin/bash
# Exists to fully update the git repo that you are sitting in...
git submodule update --init --recursive
docker-compose up -d
if [ -z "$1" ]; then
docker-compose run plugin-builder bash -c "find . -name 'pom.xml' -exec sh -c 'mvn install -f \"{}\"' \;"
else
docker-compose run plugin-builder bash -c "mvn install -f $1"
@andrewmunro
andrewmunro / index.js
Created October 20, 2017 15:34
Iota messages
const IOTA = require('iota.lib.js');
const curl = require('curl.lib.js');
const seed = 'SEEDHERE';
const tag = 'IOTATESTMESSAGE99999999999'
let iota = new IOTA({
'host': 'http://iota.bitfinex.com',
'port': 80
@andrewmunro
andrewmunro / decodeAudioData.js
Created September 21, 2017 18:15
Monkeypatch decodeAudioData to prevent errors when codec is not installed
AudioContext.prototype.decodeAudioData = (_, cb) => { if(cb) cb(new AudioContext().createBuffer(1, 19999999, 44100))};
@andrewmunro
andrewmunro / .babelrc
Created July 17, 2017 11:30
Sequelize cli with ES6
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
],
}
import React from 'react';
import {Stage, Text, Sprite} from 'react-pixi';
import config from 'config'
import GameScene from 'components/GameScene';
class AppComponent extends React.Component {
get currentScene() {
return GameScene;
}
@andrewmunro
andrewmunro / raf_core.lua
Last active August 29, 2015 14:09
Eluna Recruit a Friend script.
------------------------------------
--------- Defintions ------------
RafDaysAccountsLinked = 30
RecruiterAccounts = {}
RecruiteeAccounts = {} --Stored twice for less cpu cycles when querying
------------------------------------
--------- Create Tables ----------
local createAccountFriendsTable = [[