This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Wrapper script for importing, copying, and renaming photos, and creating gallery.""" | |
__author__ = "Joseph Reagle" | |
__copyright__ = "Copyright (C) 2024 Joseph Reagle" | |
__license__ = "GLPv3" | |
__version__ = "1.0" | |
import logging as log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sublime | |
import sublime_plugin | |
class UpdateSectionsWordCountCommand(sublime_plugin.TextCommand): | |
"""A Sublime Text command that updates word counts in markdown section headings.""" | |
def run(self, edit): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# https://github.com/STealthy-and-haSTy/EnhancedSnippets | |
# Optional: Set a tabTrigger to define how to trigger the snippet | |
#tabTrigger: "code" | |
# Optional: Set a scope to limit where the snippet will trigger | |
scope: "text.html.markdown" | |
# Optional: Set a filename glob to limit where the snippet will trigger | |
#glob: "test_*.md" | |
# Optional: Set a description for what this snippet does | |
description: "add ethnographic coding for interviews about AI & moderation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Create symbolic links from main Obsidian vault config to other vaults. | |
Obsidian configuration folder can be copied between vaults; this script | |
copies a configuration from a main vault to other vaults. | |
""" | |
from pathlib import Path | |
from shutil import copytree, rmtree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Convert Zim exported markdown to Obsidian by: | |
1. removing first heading | |
2. converting setext to atx headers | |
""" | |
# https://gist.github.com/reagle/7418f54fb6e40fe8d925e1c3f5325076 | |
import re | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"scope": "text.html.mediawiki", | |
"completions": | |
[ | |
// MACROS | |
{ | |
"trigger": "ur", | |
"annotation": "user respond", | |
"contents": ":{{u|$1}} " | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Print world clock in terminal | |
# (c) Copyright 2022 by Joseph Reagle | |
# Licensed under the GPLv3, see <http://www.gnu.org/licenses/gpl-3.0.html> | |
# | |
# replacing: https://superuser.com/questions/164339/timezone-conversion-by-command-line | |
import argparse # http://docs.python.org/dev/library/argparse.html | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Using dictionary of letter grades, calculate mean GPA from list | |
of letter grades converted to points""" | |
# https://gist.github.com/reagle/9cc2f4e2f98446528128d1f6edfe3d73 | |
# add results to e-statement-1b-teaching-trace-table.xlsx | |
__author__ = "Joseph Reagle" | |
__copyright__ = "Copyright (C) 2021-2024 Joseph Reagle" | |
__license__ = "GLPv3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Pretty print a mailbox, since some previous date, as a simple HTML file""" | |
import argparse # http://docs.python.org/dev/library/argparse.html | |
# http://docs.python.org/lib/module-email.Utils.html | |
# from email.utils import parsedate | |
import email.parser | |
import html | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Sublime Text 3 (python 2.7) plugin for wrapping text, including | |
# semantic wraps. | |
import re | |
import sublime # https://www.sublimetext.com/docs/3/api_reference.html | |
import sublime_plugin | |
SEMANTIC_BREAK_RE = re.compile( | |
r""" | |
( # end of sentence includes... | |
[a-z]{2,}| # end of word |
NewerOlder