Skip to content

Instantly share code, notes, and snippets.

// a ∨ (b ∨ c) = (a ∨ b) ∨ c, a ∧ (b ∧ c) = (a ∧ b) ∧ c associativity
// a ∨ b = b ∨ a, a ∧ b = b ∧ a commutativity
// a ∨ (a ∧ b) = a, a ∧ (a ∨ b) = a absorption
// a ∨ 0 = a, a ∧ 1 = a identity
// a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c), a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) distributivity
// a ∨ ¬a = 1, a ∧ ¬a = 0 complements
class AlgebraPoliceman[A : BooleanAlgebra : Arbitrary : Eq]() extends Properties("BooleanAlgebra") {
def zero = implicitly[BooleanAlgebra[A]].zero
def one = implicitly[BooleanAlgebra[A]].one

As compiled by Kevin Wright a.k.a @thecoda

(executive producer of the movie, and I didn't even know it... clever huh?)

please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!

This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!

Monday June 16th

;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

@aaronlifton3
aaronlifton3 / Tarjan.hs
Last active August 29, 2015 14:07 — forked from ekmett/Tarjan.hs
{-# LANGUAGE RankNTypes, GADTs, PolyKinds #-}
module Tarjan where
import Control.Applicative
import Control.Category
import Data.Monoid
import Prelude hiding ((.),id)
-- Radu Mihaesau and Robert Tarjan's Catenable Deque
@aaronlifton3
aaronlifton3 / Iso.hs
Last active August 29, 2015 14:07 — forked from ekmett/Iso.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import Control.Applicative
import Control.Arrow
import Control.Category
@aaronlifton3
aaronlifton3 / Remote.hs
Last active August 29, 2015 14:07 — forked from ekmett/Remote.hs
{-# LANGUAGE GADTs, Rank2Types, KindSignatures, ScopedTypeVariables, TypeOperators, DataKinds, PolyKinds, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, DoRec, ExtendedDefaultRules #-}
import Control.Applicative
import Control.Category
import Control.Comonad
import Control.Monad.Fix
import Control.Monad (ap)
import Data.Functor.Identity
import Data.Typeable
import Data.Monoid
import Data.Unique
package speculation
import java.util.concurrent.{ Callable, ExecutorService, Future }
class Speculation(val executor: ExecutorService, val mayInterruptIfRunning: Boolean) {
def spec[A,B](guess: => A)(f: A => B)(actual: => A): B = {
val g = executor.submit(new Callable[A] {
def call = guess
})
val speculation = executor.submit(new Callable[B] {
(* Inspired and modified based on http://drosophiliac.com/2012/09/an-academic-notetaking-workflow.html and https://gist.github.com/smargh/6068104 *)
(* PROPERTIES *)
property LF : (ASCII character 10)
property tid : AppleScript's text item delimiters
(* THE SCRIPT *)
tell application "Skim"
set the clipboard to ""
activate
@aaronlifton3
aaronlifton3 / index.html
Last active August 29, 2015 14:10 — forked from x1ddos/index.html
<html ng-app="ng-demo-app">
<head>
<title>AngularJS simple app demo</title>
</head>
<body ng-controller="MainCtrl">
<input type="text" ng-model="name" ng-required>
<div>{{name}}</div>
<div ng-controller="ChildCtrl">
<input type="text" ng-model="salut">
<div>{{salutation}}</div>