Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Koester markwk

View GitHub Profile
@markwk
markwk / category.md
Created Feb 27, 2021
Jekyll Page of Category Links
View category.md
@markwk
markwk / GenerateCategoryPages.rb
Created Feb 26, 2021
Generate Category Pages for Jekyll Blog
View GenerateCategoryPages.rb
# encoding: utf-8
#
# Jekyll categories pages generator
#
# This plugin generates pages for each of the categories of your site, as
# defined in their YAML front matter.
# If enabled through configuration, it will also generate the appropriate pagination
#
# To enable category pages generation, add the following in your _config.yml
#
@markwk
markwk / PIEL-experience-sampling-flow.survey
Created Mar 4, 2020
PIEL Survey Control File for Experience Sampling, specifically focused on tracking flow
View PIEL-experience-sampling-flow.survey
# Sample PIEL Survey for Use in Experience Sampling
# Current example is focused on tracking flow
name|Subjective Check-in
author|DataDrivenYou.com
author-email|mark@int3c.com
subject-id|0001
# can-run-once|1
can-test|0
placeholder-message|This questionaire is used to logging data about your current activity, your subjective state and your relationship to what you are doing. It is based on experience sampling method (ESM) research.
exit-message|3|Thank you for logging!
@markwk
markwk / bulk-crop-images.sh
Created Dec 4, 2019
Bulk Trim Header and Footer from Screenshots with imagemagick
View bulk-crop-images.sh
# Bulk Trim Header and Footer from Screenshots
# brew install imagemagick
for f in *.jpg;
do
convert "$f[1440x777+0+0]" "${f%.jpg}".jpg
done
@markwk
markwk / pdf_toc_processor.py
Created Oct 3, 2019
Append a Table of Contents (TOC) to a PDF Document on Mac using Only Python and No External Dependencies
View pdf_toc_processor.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#############################
#
# Append a Table of Contents (TOC) to a PDF Document on Mac using Python
#
# This script involves no external dependencies. Works and tested on Mac's default version of Python.
#
# Usage: python pdf_toc_processor.py -i <path-to-target.pdf> -b <path-to-bookmarks-file.txt> -o <path-to-output.pdf>
@markwk
markwk / text-renamer.sh
Created Apr 5, 2019
Bash script to append date of creation to a text file.
View text-renamer.sh
#!/bin/bash
cd /Users/markkoester/Desktop/
for f in *.txt ; do
if [ -f "$f" ]
then
filedatetime=$(stat -f '%Sm' -t '%Y%m%d%H%M' "$f")
filename=$(basename -- "$f")
extension="${filename##*.}"
filename="${filename%.*}"
filename="${filename// /_}"
@markwk
markwk / screenshot-renamer.sh
Created Apr 5, 2019
Mac Screenshot and Images Renamer: Run with the command line or via Alfred to give your images better titles.
View screenshot-renamer.sh
#!/bin/bash
cd /Users/markkoester/Desktop/
clipboard=''
NL=$'\n'
for f in Screenshot*.png ; do
if [ -f "$f" ]
then
filedatetime=$(stat -f '%Sm' -t '%Y%m%d%H%M.%S' "$f")
mv "$f" $filedatetime.png
# $(exiftool -d "%Y%m%d%H%M.%S" -CreateDate "$f" | awk '{print $4".png"}')"
@markwk
markwk / readings-tracker.sh
Last active Apr 7, 2019
Readings Files Tracker: Ebooks and PDFs Files Tracking, including number of files tagged with blue, red, etc.
View readings-tracker.sh
# !/bin/bash
#############################
# Readings Tracker
#
# Watch Directories of Articles and Book Files for new and modified files
#
# (Mac) Track Tagged PDF and other Files using command line tool Tag: https://github.com/jdberry/tag
#
# Data Tracking and Log Files
DATA_FILE="/Users/user/Development/data/files-reading-stats.csv"
@markwk
markwk / zettel_identifier_note_creator.bash
Created Feb 11, 2019
Generate a unique identifier for plain text file names, including optional title and opening in target app
View zettel_identifier_note_creator.bash
#!/bin/bash
#
# Bash script to generate a unique identifier for file name
# Used for a Plain Text Writing, Knowledge or Notes System
#
# Allows for following Options:
# -o: opening file in a target program
# Additional Title or name appended to end of file name
#
# Examples
@markwk
markwk / daily_morning_pages_template_note.sh
Created Nov 25, 2018
Generate plain text markdown file for morning pages.
View daily_morning_pages_template_note.sh
#!/bin/bash
# Bash script to generate a daily morning pages template
# includes file name and various date references
cd /Users/markkoester/Library/Mobile\ Documents/9CR7T2DMDG~com~ngocluu~onewriter/Documents/Notes_TheArchive
file_date=$( date '+%Y-%m-%d' )
filename="mp_$file_date.md" # prepending mp to files named according to date.
if [ -f $filename ]