Skip to content

Instantly share code, notes, and snippets.

View warrenseine's full-sized avatar
💭
🥇

Warren Seine warrenseine

💭
🥇
View GitHub Profile
@warrenseine
warrenseine / bfg.sh
Created September 13, 2014 08:12
Protect all branches when running The BFG
#!/bin/bash
set -x
set -e
BFG_URL="http://repo1.maven.org/maven2/com/madgag/bfg/1.11.7/bfg-1.11.7.jar"
BFG_BIN=`basename ${BFG_URL}`
BFG="/tmp/${BFG_BIN}"
[[ -n "$1" ]] || {
@warrenseine
warrenseine / install_emscripten.sh
Created June 24, 2014 10:26
Install Emscripten from source or emsdk
#!/bin/bash
# Copyright (c) 2014 Aerys
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@warrenseine
warrenseine / gist:6251739
Last active December 21, 2015 04:48
Get the bounding box of a group with Minko.
public function getBoundingBoxOfGroup(group : Group) : BoundingBox
{
var min : Vector4 = new Vector4(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
var max : Vector4 = new Vector4(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE);
for each (var mesh : Mesh in group.getDescendantsByType(Mesh))
{
var worldMin : Vector4 = mesh.localToWorld(
mesh.geometry.boundingBox.min, null, false, true
);
@warrenseine
warrenseine / Observer.cpp
Created November 1, 2012 16:37
C++11 Observer Pattern (removable slots, simple syntax, event-based)
#include <memory>
#include <vector>
#include <functional>
#include <unordered_map>
#include <map>
#include <string>
#include <typeindex>
#include <iostream>
#include <cassert>