Skip to content

Instantly share code, notes, and snippets.

@mudphone
mudphone / data_hawaii_gov_listing.txt
Last active December 14, 2015 17:38
http://data.hawaii.gov dataset listing as of 2013/3/8.
# FROM: https://data.hawaii.gov/browse/embed?limitTo=datasets&page=n
# WHERE: n = 1 to 36
#
# Raw datasets can be retrieved via the "ID," using this URL style:
# http://data.hawaii.gov/resource/INSERT_ID_HERE.json
# WHERE: INSERT_ID_HERE is the 4x4 ID in the list below.
#
0) Name: /Banking-Finance-and-Insurance/Export-Import-FY-2006-Applications ID: jki6-u4jp
1) Name: /Banking-Finance-and-Insurance/Export-Import-FY-2006-Participants ID: yhdt-apb3
2) Name: /Banking-Finance-and-Insurance/Export-Import-FY-2007-Applications ID: b522-5988
@mudphone
mudphone / EmacsCheatsheet.md
Last active December 16, 2015 11:49
An Emacs Cheatsheet (for me, not you)

Get Help

  • C-h f function-name function by name
  • C-h k key-sequence function name for key
  • C-h w function-name where bound by name

Move around:

  • C-x arrow-key

NREPL Clojure

More here on the nrepl page.

@mudphone
mudphone / clj-minecraft_scratch.clj
Last active December 23, 2015 16:59
Rename constant to use hyphens.
(ns cljminecraft.scratch
(:require [cljminecraft.core :as core]
[cljminecraft.bukkit :as bk]
[cljminecraft.blocks :as blocks]
[cljminecraft.events :as ev]
[cljminecraft.entity :as ent]
[cljminecraft.player :as plr]
[cljminecraft.util :as util]
[cljminecraft.logging :as log]
[cljminecraft.config :as cfg]
@mudphone
mudphone / gist:7592124
Last active December 29, 2015 01:19
From the Clojure Data Analysis Cookbook... an useful display of the lazy-seq macro.
(defn lazy-read-csv
[csv-file]
(let [in-file (io/reader csv-file)
csv-seq (csv/read-csv in-file)
lazy (fn lazy [wrapped]
(lazy-seq
(if-let [s (seq wrapped)]
(cons (first s) (lazy (rest s)))
(.close in-file))))]
(lazy csv-seq)))

Keybase proof

I hereby claim:

  • I am mudphone on github.
  • I am mudphone (https://keybase.io/mudphone) on keybase.
  • I have a public key whose fingerprint is FF35 CE0E FF69 7142 4D78 3392 BF8D EE48 35D2 BA0F

To claim this, I am signing this object:

@mudphone
mudphone / TimeDisplacement.pde
Created August 30, 2014 02:38
Time Displacement, Processing Demo, by David Muth
/**
* Time Displacement
* by David Muth
*
* Keeps a buffer of video frames in memory and displays pixel rows
* taken from consecutive frames distributed over the y-axis
*/
import processing.video.*;
@mudphone
mudphone / .Xresources
Last active August 29, 2015 14:06 — forked from vreon/.Xresources
! Molokai theme
*xterm*background: #101010
*xterm*foreground: #d0d0d0
*xterm*cursorColor: #d0d0d0
*xterm*color0: #101010
*xterm*color1: #960050
*xterm*color2: #66aa11
*xterm*color3: #c47f2c
*xterm*color4: #30309b
*xterm*color5: #7e40a5
@mudphone
mudphone / Tasks.el
Last active August 29, 2015 14:19
Elm Tasks Compile Error
Sorry if this is a dup. I thought I had posted this last night.
I have a new build of GHC 7.8.4 and Elm 0.15 on Mac OS X, and I'm getting an error trying to compile the Tasks tutorial code (from the blog post, http://elm-lang.org/learn/Tasks.elm).
I installed Elm via the install script (runhaskell BuildFromSource.hs 0.15).
The error I'm getting when trying to compile is:
````elm
$ elm make hello.elm
@mudphone
mudphone / curry.exs
Last active August 29, 2015 14:20
Elixir Curry... is delicious
defmodule Math do
def add(x, y) do
x + y
end
def add(x, y, z) do
x + y + z
end
@mudphone
mudphone / CommonMacros.ex
Last active September 9, 2015 07:45
Pipe Right (Thread Right `->>` from Clojure) - Pipes left-hand expression into the left-most parameter or the next function call.
defmodule CommonMacros do
defmacro left ~>> right do
[{h, _}|t] = Macro.unpipe({:|>, [], [left, right]})
:lists.foldl fn
{{_, _, args} = x, _pos}, acc ->
pos = Enum.count(args)
Macro.pipe(acc, x, pos)
{x, pos}, acc ->
Macro.pipe(acc, x, pos)