Skip to content

Instantly share code, notes, and snippets.

@mj-designthinks
mj-designthinks / Makefile
Created March 1, 2020 19:18 — forked from kristopherjohnson/Makefile
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc
# <http://johnmacfarlane.net/pandoc/>
#
# Run "make" (or "make all") to convert to all other formats
#
# Run "make clean" to delete converted files
# Convert all files in this directory that have a .md suffix
@mj-designthinks
mj-designthinks / pandoc.Makefile
Created March 1, 2020 19:18 — forked from bertvv/pandoc.Makefile
Makefile for Markdown -> PDF using pandoc
# Generate PDFs from the Markdown source files
#
# In order to use this makefile, you need some tools:
# - GNU make
# - Pandoc
# - LuaLaTeX
# - DejaVu Sans fonts
# Directory containing source (Markdown) files
source := src
@mj-designthinks
mj-designthinks / pandoc-html5-template.html
Created March 5, 2020 21:19
Modified version of "GitHub HTML5 Pandoc Template" v2.1 by Tristano Ajmone
$--| GitHub HTML5 Pandoc Template" v2.1 | 2018/02/28 | pandoc v2.1.1
<!DOCTYPE html>
<!-- Date Generated: 2020/03/03
\|/ /((((((\\\\ Pandoc Template customized by
-*-=======((((((((((\\\\\ Michael Joyce
/|\ (( \\\\\\\ @mj-designthinks
( (* _/ \\\\\\\
\ / \ \\\\\\________________
| | | </ ((\\\\
o_| / / \ \\\\ \\\\\\\
@mj-designthinks
mj-designthinks / cmd-line-snippets-for-pptx-files.md
Last active January 19, 2022 23:50
Command Line Snippets for Working with PPTX Files

I became frustrated after receiving PPTX files, perhaps roundtripped through Google slides, from a consultant that included strange fonts that caused errors while editing and saving. PowerPoints replace fonts function was no help. So I started to investigate how to solve the problem from the commandline and potentially build scripts to make processing easier.

Most of these one liners require GNU Grep for the extended regex. The grep and egrep included on MacOS do not work. I'm using this version of GNU Grep, aka ggrep:

ggrep (GNU grep) 3.7
Packaged by Homebrew
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@mj-designthinks
mj-designthinks / ScreenShote2Clipboard+File.workflow
Created October 30, 2025 19:35
MacOS Screenshot to File and Clipboard
-- MacOS Automator - Run AppleScript
-- Assigned to Cmd+Shift+5 keyboard shortcut in preferences
do shell script ("screencapture -iUcdx")
-- Comandline switches:
-- -i interactive
-- -U show toolbar in interactive mode
-- -c force screen capture to the clipboard
-- -d display errors to the user graphically
-- -x do not play sounds
@mj-designthinks
mj-designthinks / Clipboard2JPGorPNG.workflow
Created October 30, 2025 19:39
MacOS - Automator Script to Convert Clipboard to PNG or JPG
-- MacOS Automator Quick Action workflow - Run AppleScript
-- Useful for content copied from applications that won't paste as image into other applications
on run {input, parameters}
if ((clipboard info) as string) contains "TIFF picture" or ((clipboard info) as string) contains "class PDF" then
display dialog "Convert clipboard to:" buttons {"JPEG", "PNG"} default button 2 with icon note
if button returned of result is "PNG" then
set the clipboard to (the clipboard as «class PNGf»)
else