Skip to content

Instantly share code, notes, and snippets.

View hepplerj's full-sized avatar
💭
building the history web

Jason Heppler hepplerj

💭
building the history web
View GitHub Profile
#!/usr/bin/env python
from pandocfilters import toJSONFilter, RawInline, Str, Space
"""
Pandoc filter for Markdown that converts all notes to inline notes.
If input notes had multiple paragraphs, the paragraphs are joined
by a single space.
"""
# Ruby example
reverse_lines = File.open("poem.txt").readlines.reverse
# p reverse_lines
reverse_lines.each do |line|
words = line.split.reverse
puts words.join(" ")
end
!function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(n){return aa+n in this}function o(n){return n=aa+n,n in this&&delete this[n]}function a(){var n=[];return this.forEach(function(t){n.push(t)}),n}function c(){var n=0;for(var t in this)t.charCodeAt(0)===ca&&++n;return n}function s(){for(var n in this)if(n.charCodeAt(0)===ca)return!1;return!0}function l(){}function f(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function h(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=sa.length;r>e;++e){var u=sa[e]+t;if(u in n)return u}}function g(){}function p(){}function v(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new u;return t.on=function(t,u){var i,o=r.get(t);return arguments
x ->
i -> n -> _ -> q -> n -> 2
_ -> q -> i -> n -> g -> 4 -> n ->
3
i -> a -> n -> _
@hepplerj
hepplerj / data.json
Last active August 29, 2015 14:07
Tree Diagram
{
"name": "x",
"children": [
{
"name": "i",
"children": [
{
"name": "n",
"children": [
{
@hepplerj
hepplerj / acids.html
Last active August 29, 2015 14:07
Foodstuffs Normalized Stacked Barchart
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hepplerj
hepplerj / edgeslist.csv
Last active August 29, 2015 14:14
Token Arc
source target
I F
I F
F s
I F
d I
I F
I s
d I
I F
@hepplerj
hepplerj / index.html
Last active August 29, 2015 14:15
TokenArc
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Token Arcs</title>
<meta charset="utf-8" />
</head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<script src="visualization.js"></script>
<style>