Skip to content

Instantly share code, notes, and snippets.

View frederikaalund's full-sized avatar

Frederik Aalund frederikaalund

View GitHub Profile
package Character
import ClosureEvents
import ArchOnePerPlayer
import ArchCallback
import initlater Arena
public class Character
use AlwaysOnePerPlayer
static let onDeath = new LinkedList<MiddlewareBinary<Character, unit>>
static let onPick = new LinkedList<MiddlewareUnary<Character>>
package ArchCameraControl
import ArchOnePerPlayer
import ArchCallback
import ArchPlayers
import ClosureEvents
public class CameraControl
use OnePerPlayer
protected CameraConfig cc
@frederikaalund
frederikaalund / store.directive.ts
Created June 10, 2017 14:20
A Directive to Bind @angular-redux/store with both Template-driven and Reactive Forms
import { EventEmitter, Directive, Input, AfterViewInit, Output, OnDestroy } from '@angular/core';
import { NgForm, FormGroup } from '@angular/forms';
import { NgRedux } from '@angular-redux/store';
import { fromJS, is } from 'immutable';
import { AppState, ActionTypes } from '../store';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
function isSame(a: any, b: any) {
return is(fromJS(a), fromJS(b));
// Generate tag. Inspired by C++'s lock tags: http://en.cppreference.com/w/cpp/thread/lock_tag
struct generate_t {};
constexpr generate_t generate;
class texture {
public:
// OpenGL identifies textures by an integer "name". Ref: https://www.opengl.org/sdk/docs/man/html/glGenTextures.xhtml
GLuint name;