Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dkoontz on github.
  • I am davidkoontz (https://keybase.io/davidkoontz) on keybase.
  • I have a public key ASAiMVFYHIv4fE15nPUINoFRmR23VC90G9mtVtpXeOHTYQo

To claim this, I am signing this object:

// #![feature(proc_macro_hygiene, decl_macro)]
// #[macro_use]
// extern crate rocket;
// #[get("/hello/<name>/<age>")]
// fn hello(name: String, age: u8) -> String {
// format!("Hello, {} year old named {}!", age, name)
// }
main :: IO ()
main = do
main2
main2
main2 :: IO ()
main2 = do
t <- getLine
len <- pure $ length t
putStrLn (show len)
@dkoontz
dkoontz / november.hs
Created November 8, 2017 04:21
November Functional First work
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module Main where
main :: IO ()
main = do
putStrLn (show answer)
-- putStrLn ((<>) "Hi" " there")
-- putStrLn (combine3 "hello" " " "world")
-- putStrLn (show (invoice1 <> invoice2))
@dkoontz
dkoontz / Main.purs
Created June 1, 2016 00:03
PureScript external signals
createSignal :: forall a. a -> Signal a
createSignal = constant
data AppMessage = Init | ...
main :: (Signal Message) -> Eff (CoreEffects YourEffects) (App State Message)
main signal = do
app <- start
{ initialState: init
, update: update
@dkoontz
dkoontz / Main.hs
Last active May 6, 2016 23:22
FP Meetup Haskell Tutorial
module Main where
import Data.Either (Either)
import Data.List (intercalate)
import Data.List.Split (splitOn)
import Data.Maybe (mapMaybe, fromJust)
import Data.Monoid ((<>))
import Prelude
import System.Environment (getArgs)
@dkoontz
dkoontz / gist:c7a4e0923a9c5da3601d
Created July 14, 2015 23:40
Team Colorblind's Unity solution editor script
/*
v2: Matt Rix pointed out there's an undocumented ONGeneratedCSProjectFiles() callback
https://gist.github.com/MattRix/0bf8de88e16e8b494dbb
v1: Still available in the gist history if you want a FileSystemWatcher solution!
THE PROBLEM:
- Unity constantly rewrites its .sln files whenever you rename/add/remove scripts
@dkoontz
dkoontz / MonoBehaviourJiggle
Last active August 29, 2015 14:23
Microbenchmark test for MonoBehavior vs RobotArms Component + Processor
using UnityEngine;
public class MonoBehaviourJiggle : MonoBehaviour {
public Vector3 Amount;
void Update () {
transform.Translate(new Vector3(
Amount.x * Random.Range(-1, 1),
Amount.y * Random.Range(-1, 1),
Amount.z * Random.Range(-1, 1)