Skip to content

Instantly share code, notes, and snippets.

View jhenry's full-sized avatar

Justin Henry jhenry

View GitHub Profile
@plembo
plembo / pandocdocx2md.md
Last active March 31, 2026 08:38
Convert docx to markdown with pandoc

Convert Word documents to markdown with pandoc

I use pandoc to convert masses of Word documents to markdown. Still working on a generic script, but for now here's the "gist" of what I type into the terminal:

$ myfilename="example"
$ pandoc \
-t markdown_strict \
--extract-media='./attachments/$myfilename' \
$myfilename.docx \
@shu-yusa
shu-yusa / create_jwt.sh
Last active March 9, 2026 16:46
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
header='
{
"kid": "12345",
"alg": "RS256"
}'
payload='
{
"iss": "https://example.com",
@jamescroft
jamescroft / simple-date.html
Last active February 9, 2026 15:58
A Brightspace widget that displays the start and end date of a course offering.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script>
$.ajax({
url: '/d2l/api/lp/1.9/courses/{OrgUnitId}', //Grab course offering details
type: 'GET',
dataType: 'json',
success: function(data) {
var obj = data;
//Define dates from Course Offering as moments (if a date exists)
@kenmickles
kenmickles / Droplet.scpt
Last active December 29, 2022 07:33
AppleScript to SCP a file to a server and copy the path. Useful for sharing screenshots, etc.
use framework "Foundation"
use scripting additions
property scpTarget : "user@example.com:~/public_html/uploads"
property publicPath : "https://example.com/uploads/"
on open fileList
repeat with thisFile in fileList
set itemPath to the quoted form of the POSIX path of thisFile
do shell script ("scp " & itemPath & " " & scpTarget)
@adamreisnz
adamreisnz / package.json
Last active April 12, 2025 09:09
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@jbenet
jbenet / simple-git-branching-model.md
Last active February 26, 2026 00:08
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@jonleung
jonleung / .sh
Created July 8, 2012 19:35
Extract Wunderlist DB
cd ~/Library/Wunderlist; sqlite3 -csv -header wunderlist.db "select * from tasks left join lists on tasks.list_id=lists.id;" > wunderlist_export.csv
@semperos
semperos / rspec-sinatra-modular.rb
Created April 20, 2012 17:21
Sinatra RSpec modular app
# Spec File 1
def app
FooApp
end
describe FooApp do
# for some reason, `app` resolves to the definition BarApp given in Spec File 2 below,
# instead of the above definition
...
end
@lmarburger
lmarburger / config.ru
Created August 30, 2011 03:38
Hack Showoff to remotely drive presentation
require "showoff"
require 'pusher'
Pusher.app_id = 'insert Pusher app id here'
Pusher.key = 'insert Pusher key here'
Pusher.secret = 'insert Pusher secret here'
class PresentationController
def initialize(app)
@app = app
@seancoyne
seancoyne / iChatGrowl.applescript
Created August 11, 2011 21:52
Applescript for iChat Growl (1.2.2) Notiifications
on notify_growl(theName, theTitle, theDescription, theImage)
tell application "GrowlHelperApp"
notify with name theName title theTitle description theDescription application name "iChat" image theImage
end tell
end notify_growl
using terms from application "iChat"