Skip to content

Instantly share code, notes, and snippets.

@Japanuspus
Japanuspus / note_cleaner.py
Created August 28, 2021 20:20
note_cleaner: remove duplicate titles inside notes as added by repeated nvpy/resoph/nvalt migrations
from pathlib import Path
import re, sys, os
def clean_note_lines(title: str, lines: list[str]):
"""
Remove any lines matching title
"""
nn = re.compile(r"[^a-zA-Z0-9]")
def norm(s):
@Japanuspus
Japanuspus / main.rs
Created October 14, 2021 06:59
Cross-platform global hotkey in Rust
use tauri_hotkey as hotkey; // Discontinued, but v0.1.2 is working fine as of 2021-10-14
use std::io::{stdin, Read};
fn main() {
let spec = "ctrl+alt+r";
let mut hk = hotkey::HotkeyManager::new();
let key = hotkey::parse_hotkey(&spec).unwrap();
println!("Listening for {}. Enter to exit", &spec);
hk.register(key, move || println!("{} pressed!", &spec)).unwrap();
stdin().read(&mut [0]).unwrap(); // wait for "enter"
@Japanuspus
Japanuspus / sage plots in jupyter with standard ipython kernel.ipynb
Created August 3, 2023 09:56
Sage plots in jupyter notebooks with standard ipython kernel
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.