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
@hepplerj
hepplerj / data.json
Last active August 29, 2015 14:07
Tree Diagram
{
"name": "x",
"children": [
{
"name": "i",
"children": [
{
"name": "n",
"children": [
{
x ->
i -> n -> _ -> q -> n -> 2
_ -> q -> i -> n -> g -> 4 -> n ->
3
i -> a -> n -> _
!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
# 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
#!/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.
"""
@hepplerj
hepplerj / index.html
Last active August 29, 2015 14:03
Brush Removal with Button
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: sans-serif;
color: #000;
text-rendering: optimizeLegibility;
}
@hepplerj
hepplerj / shownotes.js
Created June 4, 2014 15:47
Bookmarklet to grab the URL, site title, and selected text, formatted in Markdown.
javascript:(function(s)%7Btry%7Bs%3Ddocument.selection.createRange().text%7Dcatch(_)%7Bs%3Ddocument.getSelection()%7Dprompt(%27Copy text%27,%27%5B%27%2Bdocument.title%2B%27%5D(%27%2Blocation%2B%27)%5Cn%5Cn> %27%2Bs)%7D)()

A quick and dirty script to check out each commit of a writing project and find the word count of each Markdown file at that point in time. You might want to use this on a clone of your writing repository. NO WARRANTY EXPRESS OR IMPLIED.

@hepplerj
hepplerj / custom.css
Created April 28, 2014 01:47
Custom Gitit CSS
@import url("screen.css"); /* default gitit screen styles */
@import url("hk-pyg.css"); /* for syntax highlighting */
/* My custom Gitit CSS styling, in part based on Twitter Bootstrap */
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
@hepplerj
hepplerj / grains.csv
Last active October 10, 2017 05:58
Sankey layout for foodstuffs
unit category use translation item subcategory value date source
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße .5 1640
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße 178 1641
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße .5 1642
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße .5 1643
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße 60 1644
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße 204 1645
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße 456 1646
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße .5 1647
Stoff (Solids) Grain millet/sorghum groats Grütze Hirße .5 1648