Skip to content

Instantly share code, notes, and snippets.

View dustinfreeman's full-sized avatar

Dustin Freeman dustinfreeman

View GitHub Profile
@dustinfreeman
dustinfreeman / machine.js
Created January 15, 2020 22:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dustinfreeman
dustinfreeman / keybase.md
Created December 1, 2019 18:29
Keybase Verification

Keybase proof

I hereby claim:

  • I am dustinfreeman on github.
  • I am dustinfreeman (https://keybase.io/dustinfreeman) on keybase.
  • I have a public key ASB1Q_ISRjzzKGNwTljWkbImsiCX5ukfXKL6Cnd9OJKrSAo

To claim this, I am signing this object:

@dustinfreeman
dustinfreeman / gist:4d86891e004258fb201919f8d94ae6f8
Last active December 24, 2019 10:53
Bulk-converting tga's to png's in a Unity project, using bash
for f in *.TGA; do mv ./"$f" ./"${f%.TGA}.tga"; done;
for f in *.TGA.meta; do mv ./"$f" ./"${f%.TGA.meta}.tga.meta"; done;
for f in *.tga.meta; do mv ./"$f" ./"${f%.tga.meta}.png.meta"; done;
for f in *.tga; do convert ./"$f" ./"${f%.tga}.png"; done;
# rm *.tga; rm *.tga.meta;
@dustinfreeman
dustinfreeman / entity_destroy_event_test
Last active August 29, 2015 14:00
Expecting to catch entity destruction events, but not getting them. Added a global entity in case destroy() has to be called in the middle of an update() function for the event to be caught.
#include <iostream>
#include <string>
#include <vector>
#include <entityx/entityx.h>
bool destruction_caught = false;
entityx::Entity testEntity_global;
struct TestEvent : public entityx::Event<TestEvent> {
#include <iostream>
#include <string>
#include <vector>
#include <entityx/entityx.h>
struct TestComponent : entityx::Component<TestComponent> {
explicit TestComponent(std::string _name = "test") {
name = _name;
}
@dustinfreeman
dustinfreeman / gist:7693920
Last active December 29, 2015 15:58
A test component and system for EntityX (https://github.com/alecthomas/entityx). Does not seem to iterate through any entities from the entities_with_components call. Am I doing something wrong?
#include <iostream>
#include <string>
#include <vector>
#include <entityx/entityx.h>
std::vector<entityx::Entity> entities_vec;
struct TestComponent : entityx::Component<TestComponent> {
TestComponent(std::string _name = "test") {