Skip to content

Instantly share code, notes, and snippets.

*.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
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 / git-sync.xql
Last active August 29, 2015 14:27 — forked from wsalesky/git-sync.xql
Sync remote eXistdb with github repository automatically using github webhooks.
xquery version "3.0";
(:module namespace gitsync = "http://syriaca.org/ns/gitsync";:)
(:~
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests.

: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. 

:
: Secret can be stored as environmental variable.
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app.