Skip to content

Instantly share code, notes, and snippets.

View bfollington's full-sized avatar
😈
scheming

Ben Follington bfollington

😈
scheming
View GitHub Profile
@bfollington
bfollington / FaceCamera.cs
Created May 19, 2019 22:27
A tiny MonoBehaviour for Unity3d that makes a sprite look at the camera
using UnityEngine;
using System.Collections;
public class FaceCamera : MonoBehaviour {
public bool LockX = false;
public bool LockY = false;
void Start () {
@bfollington
bfollington / EventManager.cs
Last active August 30, 2023 14:21
EventManager messaging layer designed for Unity
using System.ComponentModel.Design;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using System.Linq;
namespace Events
{
@bfollington
bfollington / redux.ts
Created April 11, 2019 01:25
Concise & Typesafe Redux Actions
export type Action = ReturnType<
| typeof loginRequested
| typeof logoutRequested
>
type Dispatch = React.Dispatch<Action>
export const loginRequested = (userId: string) => (<const>{
type: 'loginRequested',
payload: {
@bfollington
bfollington / main.fs
Created September 19, 2018 05:21
[F# Read Input List]
open System
let read _ = Console.ReadLine()
let isValid = function null -> false | _ -> true
let readList t =
Seq.initInfinite read
|> Seq.takeWhile isValid
|> Seq.toList
|> List.map t