Skip to content

Instantly share code, notes, and snippets.

{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "An interactive line chart of RocksDB Benchmarks.",
"width": 650,
"height": 300,
"padding": 10,
"autosize": {
"type": "fit",
"contains": "padding"
},
@duncdrum
duncdrum / 1a_dark.json
Last active June 12, 2020 21:54
ReadAct_views
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "Textual works by creator excluding unknowns",
"background": "#333",
"padding": 5,
"height": 200,
"style": "cell",
"data": [
{
"name": "source_0",
*.xlsx diff=xlsx
*.pptx diff=pptx
*.xmind diff=xmind
*.pdf diff=pdf
*.doc diff=doc
*.docx diff=docx
@duncdrum
duncdrum / Makefile
Created June 22, 2017 11:36 — forked from fasiha/Makefile
A pandoc custom writer targeting tufte-css HTML
test.html: test.md tufte-css.lua html5.html
pandoc -t tufte-css.lua -f markdown -c tufte.css --template html5.html test.md > test.html
html5.html:
pandoc -D html5 > html5.html
@duncdrum
duncdrum / xqdoc-to-markdown.xq
Last active August 22, 2020 23:01
create function documentation in markdown based on xqDoc annotations
xquery version "3.1";
(:~
: This module generates the function documentation for the xQuery modules, in the context of eXist-db.
:
: @author Duncan Paterson
: @version 0.7
:
: @return func-doc.md:)
@duncdrum
duncdrum / dec-to-hex.xql
Last active November 15, 2016 12:16
handy for unicode codepoint conversion
declare function local:decimal-to-hex ($x as xs:integer) {
(:convert decimal codepoints to unicode hexadecimal :)
if ($x = 0)
then ('0')
else concat(
if ($x gt 16)
then (local:decimal-to-hex($x idiv 16))
else (''),
substring('0123456789ABCDEF',
($x mod 16) + 1, 1))
xquery version "3.1";
import module namespace http = "http://expath.org/ns/http-client";
(: For generating the personal access token to be used in this script, please select "public_repo | Access public repositories". :)
let $git-token := "<your-github-token>"
let $user-name := "<your-github-username>"
let $repo-name := "<your-repo-name>"
let $file-path := "<file=path>"
let $message := "<commit-message>"
let $new-file-content := serialize(<a/>)
@duncdrum
duncdrum / previewtemplate.tex
Last active April 15, 2016 11:35
BibDesk preview template for Multilang with CJK sources in CMS
\documentclass[a4paper]{article}
\pagestyle{empty}
\textwidth = 6.5in
\voffset = -105pt
\hoffset = -120pt
\renewcommand{\refname}{}
%**************************************************************************************************************************
%remember to adjust Bibdesk settings for path to pdflLatex to point to xelatex, and bibtex to point to biber ($which biber) to find path
@duncdrum
duncdrum / safari-night.sh
Last active April 30, 2018 15:40
dark theme for Texshop
# Safari Reader Night Theme
# by @LogicaEns
# background = 39 40 34 (#272822)
defaults write TeXShop background_R 0.05
defaults write TeXShop background_G 0.06
defaults write TeXShop background_B 0.03
# commands = 102 217 239 (#66D9EF)
defaults write TeXShop commandred 0.3
@duncdrum
duncdrum / nat-env.xq
Created October 25, 2015 18:50
New Territories WSC Query
xquery version "3.0";
declare namespace mods="http://www.loc.gov/mods/v3";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace xlink="http://www.w3.org/1999/xlink";
import module namespace xmldb="http://exist-db.org/xquery/xmldb";
import module namespace functx="http://www.functx.com";