Skip to content

Instantly share code, notes, and snippets.

View solarkraft's full-sized avatar
🌟
Have a star!

Paul solarkraft

🌟
Have a star!
View GitHub Profile
@solarkraft
solarkraft / syncthing-automerge.py
Created December 30, 2022 18:00
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)
@solarkraft
solarkraft / custom.css
Last active March 2, 2024 12:08
Logseq custom.css for publishing
/*** Publishing: Hide things that aren't very useful for a read-only view */
/** Hide page properties (public pages will always have public: true) */
.content .pre-block { display: none; }
/** Title */
/* Make title non-editable */
#main-container .page-title { pointer-events: none; }
/** Hide useless sidebar stuff */
@solarkraft
solarkraft / firefox-chrome-urls.txt
Created May 5, 2019 04:40
A list of chrome:// URLs, retrieved through strings //usr/lib/firefox/libxul.so | grep chrome://
chrome://global/locale/global-strres.properties
chrome://branding/locale/brand.properties
chrome://global/locale/commonDialogs.properties
chrome://global/locale/css.properties
chrome://global/locale/dom/dom.properties
chrome://global/locale/intl.properties
chrome://global/locale/layout/HtmlForm.properties
chrome://global/locale/layout/htmlparser.properties
chrome://global/locale/layout_errors.properties
chrome://global/locale/mathml/mathml.properties

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@solarkraft
solarkraft / sh-L
Created February 23, 2023 14:04
Shell scripting is awesome
#!/usr/bin/env sh
addstuff=y; true && echo "a b$([ $addstuff = "y" ] && echo \" c\")"
# a b" c"
addstuff=y; stufftoadd=" c d"; true && echo a b$([ $addstuff = "y" ] && echo $stufftoadd)
# a bc d
@solarkraft
solarkraft / declutter-outlook.user.css
Last active January 13, 2023 20:09
Remove all the unnecessary junk from the Outlook Web App and polish it a little
/* ==UserStyle==
@name Declutter Outlook
@namespace https://github.com/solarkraft
@version 1.0.2
@description Remove all the unnecessary junk from the Outlook Web App and polish it a little
@author solarkraft
==/UserStyle== */
@-moz-document domain("outlook.office.com") {
#app > div > div:nth-child(2) {
[
// Quickly run tasks
{
"key": "cmd+r",
"command": "workbench.action.tasks.reRunTask"
},
{
"key": "shift+cmd+r",
"command": "workbench.action.tasks.runTask"
},
@solarkraft
solarkraft / shut_up_mac.sh
Last active December 22, 2022 01:32
Continually delete meta-files Finder keeps creating on external drives
#!/usr/bin/env bash
path=$1
check() {
file=$1
echo "Checking $file"
# Anything matching /._*
if [[ $file =~ \/\._. ]] || [[ $file =~ \/\.DS_Store ]]; then
echo "Shut up $file"
@solarkraft
solarkraft / micropython-webrepl-cli.py
Last active December 20, 2022 06:40
(Simple) MicroPython WebREPL CLI to work around newline issues
#!/usr/bin/env python
import sys
import tty
import termios
import asyncio
import websockets
uri = "ws://192.168.2.69:8266"
password = ""
{
"useTabs": true,
"tabWidth": 4,
"semi": false,
"printWidth": 120
}