Skip to content

Instantly share code, notes, and snippets.

View markwk's full-sized avatar
🎯
Focusing

Mark Koester markwk

🎯
Focusing
View GitHub Profile
@markwk
markwk / category.md
Created February 27, 2021 07:38
Jekyll Page of Category Links
@markwk
markwk / GenerateCategoryPages.rb
Created February 26, 2021 18:24
Generate Category Pages for Jekyll Blog
# 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 March 4, 2020 23:24
PIEL Survey Control File for Experience Sampling, specifically focused on tracking flow
# 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 December 4, 2019 21:00
Bulk Trim Header and Footer from Screenshots with imagemagick
# 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 October 3, 2019 19:30
Append a Table of Contents (TOC) to a PDF Document on Mac using Only Python and No External Dependencies
#!/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 April 5, 2019 04:40
Bash script to append date of creation to a text file.
#!/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 April 5, 2019 04:30
Mac Screenshot and Images Renamer: Run with the command line or via Alfred to give your images better titles.
#!/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 April 7, 2019 04:49
Readings Files Tracker: Ebooks and PDFs Files Tracking, including number of files tagged with blue, red, etc.
# !/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 February 11, 2019 06:47
Generate a unique identifier for plain text file names, including optional title and opening in target app
#!/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 November 25, 2018 03:17
Generate plain text markdown file for morning pages.
#!/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 ]