Skip to content

Instantly share code, notes, and snippets.

Started work for @alphagov!

Tristram Oaten 0atman

Started work for @alphagov!
Block or report user

Report or block 0atman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
0atman /
Last active Sep 25, 2017
The Testable Documentation Manifesto

#! blaze sh

The Testable Documentation Manifesto

One of the problems with tech documentation (api, installation instructions etc) is that they get stale. APIs change, software and plugins alter their interface and commands, and websites go away.

To solve this, I propose we write our documentation in a way that can be executed, or verified.

Luckily, I wrote blaze to execute codeblocks inside of markdown, which means that with a little help from a few common unix tools, we can solve this problem.

View contract.clj
(defn tester [x]
{:pre [(is (even? x))]}
0atman /
Last active Nov 1, 2017
Blaze is lit. It allows language-agnostic literate-style programming
0atman / pexed
Last active Sep 7, 2017
A simple wrapper around `pex`. For self-contained python scripts.
View pexed
#!/usr/bin/env sh
exec pex $requirements -- $script
0atman / future.clj
Last active Sep 27, 2017
Hy implamentation of Clojure's awesome `future` call
View future.clj
(import [multiprocessing.pool [ThreadPool]])
(defmacro future [code]
(def t (gensym))
(def pool (ThreadPool :processes 1))
(def ~t (pool.apply-async (fn [] ~code)))
View Untitled.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View vis.html
<script type="text/javascript" src=""></script>
<link href="" rel="stylesheet" type="text/css" />
<style type="text/css">
#mynetwork {
width: 600px;
height: 400px;
border: 1px solid lightgray;
View future.clj
(defn return_after_5_secs [message]
(do (Thread/sleep 5000) message))
future = (future return_after_5_secs “hello”)
(realized? future)
(Thread/sleep 5000)
(realized? future)
(println @future)
from concurrent.futures import ThreadPoolExecutor
from time import sleep
def return_after_5_secs(message):
return message
pool = ThreadPoolExecutor(3)
future = pool.submit(return_after_5_secs, ("hello"))
View react.js
class HelloMessage extends React.Component {
render() {
return <div>Hello {}</div>;
ReactDOM.render(<HelloMessage name="John" />, mountNode);
You can’t perform that action at this time.