Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Paul Jacobson pauljacobson

:octocat:
View GitHub Profile
@pauljacobson
pauljacobson / image_manipulation.py
Created May 30, 2022
Script to take in TIFF images and reformat them as JPEG images using Pillow
View image_manipulation.py
#!/usr/bin/env python3
from pathlib import Path
from PIL import Image
from rich.console import Console
from rich.traceback import install
# Add support for Rich traceback formatting
install(show_locals=True)
@pauljacobson
pauljacobson / Lazy_DM_checklist_adaptation.md
Created Jun 10, 2021
This is my adaptation of the Lazy DM checklist for my use in Obsidian
View Lazy_DM_checklist_adaptation.md
alias tags cssclass

Main: [[Campaigns]] Related:

{{title}}

@pauljacobson
pauljacobson / Dnd_campaign_MOC.md
Created Jun 10, 2021
This is my current template for DnD Campaign overview notes. It is optimized for my use using Obsidian
View Dnd_campaign_MOC.md
alias tags cssclass

Main: Related:

{{title}}

@pauljacobson
pauljacobson / vault_stats.py
Last active Apr 8, 2022
A Python script to generate Obsidian vault stats
View vault_stats.py
# Huge thanks to Rythm for the original code
# that I adapted for this script
# Source: https://j.mp/2UPeDJh
import os.path
import datetime
FILE_PATH = "/path/to/vault/directory/"
TODAY = datetime.datetime.today()
LAST_UPDATE = "{:%A %d %B, %Y at %H:%M}".format(TODAY)
@pauljacobson
pauljacobson / keybase.md
Created Dec 14, 2019
Keybase authentication
View keybase.md

Keybase proof

I hereby claim:

  • I am pauljacobson on github.
  • I am pauljacobson (https://keybase.io/pauljacobson) on keybase.
  • I have a public key whose fingerprint is B767 1A40 637B 27BF 53A3 B910 D424 1DB0 D2D6 AA5C

To claim this, I am signing this object:

View Python_file_rename.py
from pathlib import Path
for file in Path(".").glob("*.1"):
name, ext, _ = file.name.split(".") # There were no other .'s in the names
file.rename(f"{name}.sld{ext}")
# From https://dev.to/rpalo/automating-simple-things-with-python-is-awesome-3jlg
@pauljacobson
pauljacobson / VSCode_MAiO_extension_logs
Created Jun 8, 2018
Error logs from VS Code when doing text expansion, with Markdown All in One enabled
View VSCode_MAiO_extension_logs
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1311 ERR Invalid array length: RangeError: Invalid array length
at /Users/pauljacobson/.vscode/extensions/yzhang.markdown-all-in-one-1.4.0/out/src/toc.js:68:21
at Generator.next (<anonymous>)
at fulfilled (/Users/pauljacobson/.vscode/extensions/yzhang.markdown-all-in-one-1.4.0/out/src/toc.js:4:58)
at <anonymous>
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1311 WARN Error: listener failed
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3419:135
at Object.g [as _notify] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:149:807)
at Object.enter (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:153:85)
@pauljacobson
pauljacobson / Table_template
Last active Jan 29, 2018
A basic table layout
View Table_template
<p>Table</p>
<table>
<colgroup>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
@pauljacobson
pauljacobson / package.json build scripts
Created Nov 7, 2017
I've been working on npm build scripts to support my web development projects and finally came up with a series of scripts that cover my basic build requirements. This is a test file that I created. It isn't the most elegant set of scripts (or particularly feature-rich) but they're a start.
View package.json build scripts
{
"name": "css-node_imports",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"build": "npm run-script clean && npm run-script css && npm run-script files && npm run-script js",
"clean": "trash dist/**",
"postclean": "mkdir dist/ && mkdir dist/assets/",
"precss": "mkdir dist/assets/styles/",
@pauljacobson
pauljacobson / A Real-Time Date-Time Script in JavaScript (ES6) - variation
Created Oct 25, 2017
This is a variation on my previous Real-Time Date-Time script
View A Real-Time Date-Time Script in JavaScript (ES6) - variation
Date.prototype.dayName = function() {
const today = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
return today[this.getDay()];
}
function time() {
const now = new Date().toLocaleTimeString('en-GB');
const dateNow = new Date().toLocaleDateString('en-GB', {year: 'numeric', month: 'long', day: 'numeric'});
const todayNow = new Date().dayName();
document.querySelector('.clock').innerHTML = `<p>Today is ${todayNow}, ${dateNow}. The current time is ${now}.</p>`;