Skip to content

Instantly share code, notes, and snippets.

View lancelet's full-sized avatar
🖖
Reconfiguring the Primary Power Coupling

Jonathan Merritt lancelet

🖖
Reconfiguring the Primary Power Coupling
View GitHub Profile
@lancelet
lancelet / monop.hs
Last active August 29, 2015 14:17
Monoid operations on the free monoid
import Data.Monoid (Monoid(..))
{-
Summary
If we have a type, 'a', and some monoid defined for 'a', then 'Operation' is an AST representing
computations that could be done by the monoid. 'Operation' can represent something like
[ 1, 2, 3 ] ++ ( [4, 5, 6] ++ [] )
or
@lancelet
lancelet / yi.hs
Created October 20, 2014 04:24
yi.hs configuration (modeline doesn't seem to cooperate)
-- in ~/.config/yi/yi.hs
import Data.Monoid ((<>))
import Yi (Attributes(..), Config, UIConfig(..), configUI, defaultEmacsConfig, emptyAttributes, override, yi)
import Yi.Style (Color(..), UIStyle(..), grey, withBg, withFg)
import Yi.Style.Library (defaultTheme)
config :: Config
config = defaultEmacsConfig
{ configUI = (configUI defaultEmacsConfig)
@lancelet
lancelet / gist:595a48ee9db984727e0b
Created July 3, 2014 01:09
Project typeclasses over collections?
import scala.collection.immutable._
object TypeclassProjection {
trait Show[T] {
def show(t: T): String
}
object Show {
def apply[T](showFn: T => String): Show[T] = new Show[T] { def show(t: T): String = showFn(t) }
}
@lancelet
lancelet / .emacs
Last active December 17, 2015 11:29
NOTE: This now has its own repository: https://github.com/lancelet/dotemacs Yes, it's sad, I know. My .emacs file. It comes with an accompanying shell script which sets up the ~/.emacs.d/vendor directory with required additions. This isn't guaranteed to work for anyone but me.
;---------------------------------------;
; JONATHAN MERRITT'S EMACS STARTUP FILE ;
;---------------------------------------;
; Setup:
;
; 1. Create vendor directory:
; > mkdir -p ~/.emacs.d/vendor
;
; 2. Install milkypostman/powerline (cute status bar / modeline):
; > cd ~/.emacs.d/vendor
@lancelet
lancelet / drip-classpath-test.sh
Created November 19, 2012 19:10
Does drip pick up classpath changes?
#!/bin/bash
#-----
# Test to see if drip picks up classpath changes.
#
# NB: For safety, create a new directory in which to execute this script!
#
# The drip utility (https://github.com/flatland/drip) is a way to launch a JVM
# quickly. It works by keeping "a fresh JVM spun up in reserve with the
# correct classpath and other JVM options".
#