This file contains hidden or 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
# WHAT IS IT | |
# This is a hacky little script to generate Mermaid flowcharts from Notion page relations across databases | |
# TO USE: | |
# - Grab your Notion API key and stick it in "token" | |
# - Make sure you've allowed your databases access via "Share" (for each database!) | |
# - Run the script, copypasta from command line into a code block | |
# TO DO: | |
# - Add filtering of relations (a kind of config) |
This file contains hidden or 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
echo .DS_Store >> ~/.gitignore_global | |
git config --global core.excludesfile ~/.gitignore_global |
This file contains hidden or 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 pathlib | |
import re | |
import sys | |
# TODO | |
# - check if we're parsing raw clippings into | |
# - a new author file | |
# or | |
# - appending to existing author store | |
# - use markdown tree so we can add clips to existing books |
This file contains hidden or 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 time | |
from PyQt5.QtCore import QTimer | |
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QProgressBar, QPushButton | |
import multiprocessing | |
from multiprocessing import shared_memory | |
import numpy as np | |
DATA_SIZE = 1 | |
DTYPE = np.int64 |
This file contains hidden or 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 queue | |
from pyqtgraph.Qt import QtGui, QtCore | |
import numpy as np | |
import pyqtgraph as pg | |
import multiprocessing | |
import time | |
# This function is responsible for displaying the data | |
# it is run in its own process to liberate main process |
This file contains hidden or 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
mkdir adjusted | |
for f in *.JPG | |
do convert $f -normalize -modulate 100,130,100 adjusted/$f.jpg | |
done |
This file contains hidden or 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
# png/jpg --(mogrify/magick)--> ppm --(mkbitmap)--> pbm --(potrace)--> svg | |
# mkbitmap parameters: | |
# -f n == Apply a highpass filter to the image.The parameter n is a radius (in pixels) which corresponds approximately to the size of details which should be preserved. | |
# -s n == Scale the image by an integer factor n>0. | |
# -3 == Use cubic interpolation when scaling to a higher resolution. | |
# -t n == Set the threshold grey value for bilevel conversion. | |
'''shell | |
mogrify -format ppm *.jpg |
This file contains hidden or 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
fts(){ | |
find $1 -type f -print | grep $2 | xargs rg $3 | |
} |
This file contains hidden or 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 sys | |
""" | |
This is a helpful little script for importing your kindle underlines from books. | |
Because I read multiple books at once, my underlines get mixed up and out of order. | |
This script untangles my underlines and puts each book into a nice neat markdown file. | |
Things to be wary of: | |
- Author names should be adjusted to be 3 words or less (including hyphenations) |