This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> import Control.Applicative | |
This post is a [literate | |
Haskell](https://gist.github.com/kisom/09e471e145bf1eca9124) file, | |
converted to org-mode with [Pandoc](http://pandoc.org). | |
Time to explore the `Applicative` type. | |
First, `fmap`: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*-lisp-*- | |
;; Load swank. | |
;; *prefix-key* ; swank will kick this off | |
(ql:quickload :swank) | |
(ql:quickload :manifest) | |
(defvar *manifest-url* | |
(manifest:start)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ATTRS{idVendor}=="5332", ATTRS{idProduct}=="1300", ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="on" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# convert Nikon NEF RAW images to FITS. | |
# | |
# depends on dcraw and imagemagick: | |
# apt-get install dcraw imagemagick | |
IMAGE_LIST="$1" | |
if [ -z "$IMAGE_LIST" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun count-macroexpansions (form) | |
(labels ((count-expansions (form n) | |
(multiple-value-bind | |
(expansion expanded) | |
(macroexpand-1 form) | |
(if expanded | |
(count-expansions expansion (+ n 1)) | |
n)))) | |
(count-expansions form 0))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Purity is a useful construct that forces programmers to consider that the | |
environment that they are operating in is unclean, and this introduces | |
barriers to formally defining the behaviour of the system comprising | |
the program and its environment. | |
This file is a [literate Haskell | |
file](https://gist.github.com/kisom/3863f17636d99b4f8401) run through | |
[pandoc](http://johnmacfarlane.net/pandoc/) to produce a Markdown | |
post. There might be a few glitches as I'm still developing a workflow | |
in this style. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(This post is a Literate Haskell file that was run through pandoc to | |
produce markdown). | |
It seems customary in the Haskell space to write an introduction to | |
monads; my attempt in this exposition is not to outdo anyone else, but | |
to make the topic clear enough that I can write about it. My hope is | |
that by doing so, it becomes more clear to me. | |
> module Perhaps where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CONTAINER="$1" | |
BASENAME="$2" | |
OWNER="[email protected]" | |
if [ -z "$BASENAME" ] | |
then | |
echo "No basename provided." | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Produce an HTML file displaying code coverage. Dependencies: | |
# - cloc (apt-get install cloc) | |
# - cover (go get code.google.com/p/go.tools/cmd/cover) | |
if [ -z "$1" ]; then | |
PKG="" | |
else | |
PKG=$1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This program is a simple web server that listens for IP address | |
// updates. There's no authentication or security at all; I use it | |
// to keep track of beaglebones on a LAN. | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" |