Skip to content

Instantly share code, notes, and snippets.

View mattfield's full-sized avatar
🫠

Matt Field mattfield

🫠
View GitHub Profile
# Functional JS - Event Handler
## What is FP: 15 mins [tim]
## Defining features: 5
### Vs OOP: 5
- flat
#! /usr/bin/env sh
RUBY_VERSION="1.9.1"
SERVER="${HOME}/.gem/ruby/${RUBY_VERSION}/bin/camper_van"
PIDFILE="/tmp/camper_van.pid"
if [ ! -e ${SERVER} ]; then
echo "CamperVan server not found at '${SERVER}'."
fi

Everything David Nolen Mentioned

When watching David Nolen's excellent Lambda Jam keynote on InfoQ, the references to interesting reading came a little too fast and furious for me to jot down, so I went through the slides and put this gist together.

/*
turns a binary function into a variadic function via reduction
*/
var reducify = function(fn){
return function(){
var args = [].slice.call(arguments)
return args.reduce(fn)
}
@mattfield
mattfield / fizz_buzz.hs
Last active December 21, 2015 01:58 — forked from adtaylor/fizz_buzz.rb
module Main where
import Data.Monoid (mappend)
import Data.Maybe (fromMaybe, listToMaybe, maybe)
import System.Environment (getArgs)
fizzbuzz i = fromMaybe (show i) $ mappend ["fizz" | i `rem` 3 == 0]
["buzz" | i `rem` 5 == 0]
main = mapM_ putStrLn [ fizzbuzz i | i <- [1..100] ]