Skip to content

Instantly share code, notes, and snippets.

(ns user
(:require [schema.core :as s]
[schema.utils :as s-utils]))
(defn filter-walker
"Creates a walker which replaces sub-trees in values of maps with nil
if they do not conform to schema."
[schema]
(s/start-walker
(fn [schema]
@tgk
tgk / core.clj
Created December 17, 2013 17:45
Proposal for Riemann/Compojure routing integration
(ns compojure-augmented.core
(:require [compojure.core]))
(def bare
(compojure.core/GET
"/foo/:bar" [bar]
{:status 200
:body (str "Hello " bar)}))
(bare
@tgk
tgk / README.md
Last active December 23, 2015 16:09
Christmas tree dashboard

A simple Riemann dashboard design with functionality similar to the grid layout from Riemanns built in dashboard.

@tgk
tgk / index.html
Created September 19, 2013 12:50
Animating date axis
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript">
var width = 960,
@tgk
tgk / README.md
Created September 15, 2013 10:26
Propagator values illustration

First prototype of propagator values over time for presentation.

@tgk
tgk / README.md
Last active April 19, 2019 18:31
Add and remove nodes

Click to add nodes! Nodes near the cursor will be linked to the new node. Clicking an existing node will remove it.

This is an extension of this example, adding the capability of removing nodes by clicking them. This means that dragging is no longer supported.

@tgk
tgk / README.md
Created July 20, 2013 07:56
Demographic treemap with tooltip

Demographics treemap with population distribution and revenue obtained from that demographic associated with each node. The (fictitious) demographics data is loaded from a CSV file, whereas the revenue data is randomly generated.

@tgk
tgk / README.md
Created July 17, 2013 11:46
Voronoi diagram for British outbound postcodes

Voronoi diagram for British outbound postcodes. The voronoi function breaks when the data points close to each other are not removed.

@tgk
tgk / README.md
Last active December 19, 2015 20:19
Projection of all British outbound postcodes

Projection of all British outbound postcodes (also known as "the bit before the space")

@tgk
tgk / gist:5947386
Created July 8, 2013 09:14
Iterate over filenames and execute command in bash
for f in ~/dir/*.txt; do bin/do_thing $f; done