View asciicast-transformations.py
import sys
import asciinema.asciicast as asciicast
import asciinema.asciicast.events as ev
# predicates
def _(actual):
return True
View edit-asciicast.py
import sys
import os
import json
import asciinema.asciicast as asciicast
import asciinema.asciicast.frames as frames
# run me with:
# python3 edit-asciicast.py original.cast edited.cast
View asciinema-upload.sh
# replace api-token with actual token from ~/.config/asciinema/config
curl -v -X POST -u $USER:api-token https://asciinema.org/api/asciicasts -F asciicast=@/path/to/recording.json
View poolboy_demo.ex
defmodule HttpRequester do
use GenServer
def start_link(_) do
GenServer.start_link(__MODULE__, nil, [])
end
def fetch(server, url) do
# Don't use cast: http://blog.elixirsips.com/2014/07/16/errata-dont-use-cast-in-a-poolboy-transaction/
timeout_ms = 10_000
View cleanup-input-stream.clj
(ns example
(:import java.io.FilterInputStream))
(defn cleanup-input-stream
"InputStream wrapper which calls given callback after
the stream is closed."
[is cleanup]
(proxy [FilterInputStream] [is]
(close []
(proxy-super close)
View streams.clj
(ns cheshire.experimental
(:require [cheshire.core :refer :all]
[clojure.java.io :refer :all])
(:import (java.io ByteArrayInputStream FilterInputStream
SequenceInputStream)))
(defn escaping-input-stream
[is]
(let [new-is (proxy [FilterInputStream] [is]
(read
View benchmark.md

Naive micro-benchmark of reduce/sum I made to get the idea of raw performance range of different dynamic languages / different runtimes.

For each of these I repeated the execution until the timing stopped changing in major way (JIT etc), and saved only the last run.

Don't take it too seriously ;)

View asciinema-theme-monokai.css
/* Based on Monokai from base16 collection - https://github.com/chriskempson/base16 */
.asciinema-theme-monokai .asciinema-terminal {
color: #f8f8f2;
background-color: #272822;
border-color: #272822;
}
.asciinema-theme-monokai .fg-bg {
color: #272822;
}
.asciinema-theme-monokai .bg-fg {
View danny.datalog
[:find ?actor
:where
[?d :person/name "Danny Glover"]
[?d :person/born ?danny-age]
[?a :person/name ?actor]
[?a :person/born ?actor-age]
[?m :movie/cast ?a]
[(< ?actor-age ?danny-age)]]
View web-controllers-doc_controller.ex
defmodule Asciinema.DocController do
use Asciinema.Web, :controller
def show(conn, _params) do
conn
|> put_layout(:docs)
|> render("show.html")
end
end