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 / set-up-formatting.patch
Created October 3, 2025 21:26
Customize formatting on Vite React+TS project
From 09c136006b11872d7b9d713440b2566a5f4f36c3 Mon Sep 17 00:00:00 2001
From: solarkraft <>
Date: Fri, 3 Oct 2025 23:24:20 +0200
Subject: [PATCH] Set up formatting
---
.prettierignore | 3 +++
.prettierrc | 6 ++++++
.vscode/settings.json | 4 ++++
package.json | 4 +++-
@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 / syncthing-automerge.py
Last active August 20, 2025 12:28
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™️).
# This script automatically handles Syncthing conflicts on text files by applying a
# git three-way merge between the previously synced version and each divergent version.
# It depends on the watchdog package and git.
# For automatic dependency installation when running with ´uv run --script deconflicter.py´:
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "watchdog",
@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 = ""
@solarkraft
solarkraft / tasks.json
Last active November 11, 2022 02:40
VSCode: Run current file/selected text
{
// You can bind "Rerun Last Task" to something convenient like cmd+R
"version": "2.0.0",
"tasks": [
{
"label": "Run current file",
"type": "shell",
"command": "echo Running from file: \"$(cat ${file})\"",
},
{
@solarkraft
solarkraft / .prettierignore
Last active October 3, 2025 21:17
Standard prettier & vscode formatting setup. Do full format with `prettier --write .`
pnpm-lock.yaml
node_modules
dist
// ==UserScript==
// @name Tidal declutterer
// @namespace http://tampermonkey.net/
// @version 0.7
// @description Gives the Tidal web app some nice visual tweaks and hides non-personalized recommendations (ads). User configurable.
// @author [email protected]
// @match https://listen.tidal.com/*
// ==/UserScript==
// The app is made with react and it would be preferable to directly hook into that to