Skip to content

Instantly share code, notes, and snippets.

@dtjohnso
dtjohnso / csplit-md.sh
Created May 7, 2020 18:25
Split a Markdown file into separate files at the ## h2 heading
# A script to split a .MD file into chunks, separating on h2 ## headings
# Duncan Johnson
# csplit test.md -f 'ch' --suffix-format='%03d.md' "/^## /" "{*}" -s
csplit $1 -f 'ch' --suffix-format='%02d.md' "/^## /" "{*}" -s
@dtjohnso
dtjohnso / front-matter.yml
Created July 25, 2019 14:28
Front-matter examples from my blog
---
layout: post
title: "Block class on John's Epistles"
date: 2014-03-10 10:00
comments: true
category: Exegesis
tags: Books
description: A good book on the books of 1--3 John.
image: /images/2014/03/tn_9780802825186.jpg
---
@dtjohnso
dtjohnso / convert.sh
Created March 19, 2019 15:10
Converting Visio templates (VSS) to Open Document Graphics (ODG)
# Once you've done this you can then convert the VSS files to ODG files. It produces a picture per page, some of the layout is up the creek, but you have the image now.
vss2odg Oracle-Server-Blade.vss Oracle-Server-Blade.odg
@dtjohnso
dtjohnso / Current.sublime-build
Created November 9, 2013 22:43
A couple sample build systems for Sublime Text 2.
{
// standard one, non-standalone HTML to 00-MarkdownOutput.html
// Turabian citation style
"cmd": ["pandoc","--smart","-o","00-MarkdownOutput.html","$file_name","--csl","C:\\Users\\Duncan\\Github\\styles\\turabian-fullnote.csl","--bibliography","C:\\Users\\Duncan\\Github\\sources\\zotero-sources.bib","--bibliography","C:\\Users\\Duncan\\Github\\sources\\bibleworks-sources.bib"],//,"--bibliography","C:\\Users\\Duncan\\Github\\sources\\logos-sources.bib"],
// standalone HTML using source file name as base
// MLA Citation style
// "cmd": ["pandoc","--smart","-s","-o","$file_base_name.html","$file_name","--bibliography","C:\\Users\\Duncan\\Github\\sources\\zotero-sources.bib","--bibliography","C:\\Users\\Duncan\\Github\\sources\\bibleworks-sources.bib","--csl","C:\\Users\\Duncan\\Github\\styles\\modern-language-association.csl","-c","C:\\Users\\Duncan\\Dropbox\\standalone.css"],//"--bibliography","C:\\Users\\Duncan\\Github\\sources\\logos-sources.bib",
@dtjohnso
dtjohnso / logos-resources.bib
Last active December 26, 2015 05:49
Bibtex file for my Logos library
@misc{Comfort_Barrett_2001,
place={Wheaton, IL},
title={0162},
journal={The text of the earliest New Testament Greek manuscripts},
publisher={Tyndale House},
author={Comfort, Philip Wesley and Barrett, David P.},
year={2001}}
@misc{Comfort_Barrett_2001,
place={Wheaton, IL},
title={0171},
@dtjohnso
dtjohnso / ParseXML.bas
Created May 3, 2011 21:09
Trying to grab XRECORD via MARC callnum
'Similar to Query, but using WinHttpRequest 5.1
Private Function HttpRequest(url As String) As String
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
objHTTP.Open "GET", url, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send ("")
HttpRequest = objHTTP.responseText
End Function
Private Sub testget()
@dtjohnso
dtjohnso / google-books.htm
Created April 26, 2011 12:37
Google Book Search and Millennium
<html>
<head>
<title>Meriam Library - CSU, Chico /All Locations</title>
</head>
<body>
</script>
[JavaScript Error: "Translate: translator called select items with no items" {file: "file:///H:/zotero%20profile/translators/Google%20Books.js" line: 0}]
[JavaScript Error: "Translate: translator called select items with no items" {file: "file:///H:/zotero%20profile/translators/Google%20Books.js" line: 0}]
@dtjohnso
dtjohnso / Curated Millennium search.htm
Created March 14, 2011 21:00
Enables keyword searching with a hard-coded subject category on a III Millennium catalog.
<!-- Suggested test search strings: Daniel, puppet, David -->
<script src="http://code.jquery.com/jquery-1.5.js"></script>
<form target="blank" action="http://library.bju.edu/search/X" id="search" style="margin: 0 0 20px 0;">
<input name="search" type="hidden" id="target"/>
<input name="searchscope" value="7" type="hidden" />
<input name="SORT" value="D" type="hidden" />
<input name="userInput" id="userInput" size="30" maxlength="75" /><br/>
<input value="Search" type="submit" />
<input value="Reset" type="reset" />
</form>
@dtjohnso
dtjohnso / TypographicalReplace.bas
Created September 17, 2010 12:13
Some of the characters don't show right in default view, click download or raw to get everything
Sub CurlyQs()
'
' CurlyQs Macro
' Macro first recorded Thursday, September 11, 2003 by Mark L Ward Jr
' Refactored with regex by Duncan Johnson Sept 17, 2010
'
' Makes assorted typographical corrections
FindReplace " "," " 'double spaces with a single space
FindReplace """","""" 'straight double quote with smart quote (assumes Smart Quotes are enabled in Word settings)