Skip to content

Instantly share code, notes, and snippets.

View FranklinChen's full-sized avatar

Franklin Chen FranklinChen

View GitHub Profile
@FranklinChen
FranklinChen / walk-tree.hs
Created April 26, 2015 03:09
Merge a list of annotations into selected nodes of a tree, with error recovery and reporting
-- | Something for work, prototyped first in Haskell before turning
-- into Scala
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE LambdaCase #-}
import Test.Hspec
import Control.Monad.State
{-# LANGUAGE RankNTypes, DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
module Main where
import Criterion.Main (defaultMain, bench, bgroup, nf)
--------------------------------------------------------------------------------
-- Fixed points of a functor
newtype Mu f = Mu { muF :: f (Mu f) }
-- | http://stackoverflow.com/questions/14259229/streaming-recursive-descent-of-a-directory-in-haskell/14261710#14261710
--
-- Updated to latest Pipes 4.
module Main where
import Pipes
import qualified Pipes.Prelude as P
import Control.Monad (forM_)
import System.Directory (doesDirectoryExist, getDirectoryContents)
@FranklinChen
FranklinChen / playground.rs
Last active November 15, 2015 05:58 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::thread::{spawn, sleep_ms};
use std::sync::mpsc::channel;
fn main() {
// Names of attendees.
let names = vec![format!("A"), format!("B"), format!("C"), format!("D"), format!("E")];
// Create a channel to communicate between attendees and the toaster.
let (toaster_tx, toaster_rx) = channel();
@FranklinChen
FranklinChen / playground.rs
Created November 15, 2015 06:11 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::sync::{Arc, Mutex};
use std::thread;
struct Toaster {
count: u32
}
impl Toaster {
fn new() -> Toaster {
Toaster { count: 0 }
@FranklinChen
FranklinChen / # shibboleth-sp - 2016-09-28_16-50-24.txt
Created September 28, 2016 20:56
shibboleth-sp on macOS 10.12 - Homebrew build logs
Homebrew build logs for shibboleth-sp on macOS 10.12
Build date: 2016-09-28 16:50:24
@FranklinChen
FranklinChen / keybase.md
Created November 28, 2016 18:40
Keybase proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: