Skip to content

Instantly share code, notes, and snippets.

@stayingqold
stayingqold / clean_roam_titles_for_obsidian.md
Last active December 16, 2023 23:12
Convert Roam titles to he Obsidian Compatible

This script goes through a .json exported roam graph and converts the '/' characters in page titles with a '-' character.

Useful for Obsidian migration, because Obsidian interprets a file with the title '12/16 Math Notes' as a file called '16 Math Notes' in the folder '12/'.

import json

def replace_slashes(data):
    if isinstance(data, dict):
 for key, value in data.items():
@stayingqold
stayingqold / touchbar_restart.sh
Created February 11, 2020 23:21
Restarts the Touch Bar on MacBooks
#!/bin/bash
# Found these commands in this article:
# https://medium.com/zenchef-tech-and-product/how-to-kill-and-restart-the-touch-bar-control-strip-on-the-new-macbook-pro-b77e97c11d03
pkill "Touch Bar agent";
killall "ControlStrip";
echo touchbar restarted