Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE TupleSections #-}
import Control.Lens
data Expr
= Var String
| App Expr Expr
| Lam String Expr
deriving Show
Postgres Cheat Sheet
Source: Postgresql Documentation
### shell commands
creatuser <user>
deletesuer <user>
createdb -O <user> -E utf8 -T <template> <db_name>
dropdb <db_name>
@christiantakle
christiantakle / fix-free-cofree.hs
Created January 25, 2017 09:43 — forked from jtobin/fix-free-cofree.hs
Fix, Free, and Cofree
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
import Prelude hiding (succ)
newtype Fix f = Fix (f (Fix f))
deriving instance (Show (f (Fix f))) => Show (Fix f)
@christiantakle
christiantakle / leaf.hs
Created March 22, 2016 10:10 — forked from ali-abrar/index.html
Setting up Leaflet.js with Reflex.Dom
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
import Reflex.Dom
import Data.Monoid
import GHCJS.Types
import GHCJS.Foreign
import GHCJS.DOM.Element
import GHCJS.DOM.Types
import Control.Monad.IO.Class
newtype LeafletMap = LeafletMap { unLeafletMap :: JSRef LeafletMap }
@christiantakle
christiantakle / springer-free-maths-books.md
Created December 28, 2015 23:39 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
#!/usr/bin/env ruby
tagname = ARGV.pop
def prompt(*args)
print(*args)
gets.chomp
end
if tagname.nil?
<?xml version="1.0"?>
<root>
<item>
<name>Programmer's Shift Keys</name>
<!--
Author: Carwin Young (@carwin)
Last Updated: 2013.02.10
v.1.0
Programmer's Shift Keys
@christiantakle
christiantakle / 1.js
Last active August 29, 2015 14:23 — forked from chrisbuttery/1.js
// fade out
function fade(el) {
var op = 1;
var timer = setInterval(function () {
if (op <= 0.1){
clearInterval(timer);
el.style.display = 'none';
}
el.style.opacity = op;
{
"dependencies": {
"jshint": "latest",
"uglifyjs": "latest",
"watch": "latest"
},
"config": {
"github_url": "https://api.github.com/repos/MarkBiesheuvel/markbiesheuvel.nl/commits?page=1&per_page=10",
"maps_url": "https://maps.googleapis.com/maps/api/staticmap?size=640x200&zoom=7&markers=color%3Ablue%7Clabel%3AH%7C51.469941%2C5.472258&markers=color%3Ayellow%7Clabel%3AW%7C51.574344%2C5.13781",
},
# Generates the text of asetniop.vim
singles =
a: "a"
s: "s"
e: "d"
t: "f"
n: "j"
i: "k"
o: "l"
p: ";"