Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
migueldeicaza / godot-mixed-coretext-hacks.patch
Last active August 19, 2025 14:28
Ugly and contains two unrelated things, a CoreText backend (which I broke) and using CoreText-fonts to render fonts in the regular codepath.
diff --git a/editor/project_manager/project_manager.cpp b/editor/project_manager/project_manager.cpp
index 507931c744..ac2539a3ba 100644
--- a/editor/project_manager/project_manager.cpp
+++ b/editor/project_manager/project_manager.cpp
@@ -1498,7 +1498,7 @@ ProjectManager::ProjectManager() {
filter_option->connect(SceneStringName(item_selected), callable_mp(this, &ProjectManager::_on_order_option_changed));
hb->add_child(filter_option);
- filter_option->add_item(TTRC("Last Edited"));
+ filter_option->add_item(TTRC("😀Last Edited"));
@pbinkley
pbinkley / weekly.py
Last active January 21, 2025 00:50
Python script to generate a weekly note for Obsidian, with embedded Google Calendars for each day and inclusion of Obsidian tasks using dataview plug-in
import datetime
from string import Template
import os.path
# create Weekly Notes file for current week
# - replaces the Periodic Notes plugin, which stopped working
# correctly for me in Jan. 2025 (it kept using the year 2024)
# - to run: open terminal, cd to "Obsidian environment/Scripts",
# run "python3 weekly.py"
@RhetTbull
RhetTbull / resolve_macos_alias.py
Last active November 15, 2025 06:09
Resolve macOS alias path in Python
"""Resolve path to macOS alias file
Given a path to a file that is a macOS alias, resolve the path to the original file
Requires: pip install pyobjc-core
"""
from Foundation import (
NSURL,
NSData,
@RhetTbull
RhetTbull / resolve_macos_alias_path.py
Created May 27, 2024 00:21
Resolve path to original file pointed to by macOS alias
"""Resolve path to original file pointed to by macOS alias
To use:
pip install pyobjc-core
python3 resolve_macos_alias_path.py /path/to/alias
"""
from Foundation import (
NSURL,
@deathau
deathau / background.js
Created April 16, 2024 06:51
Inoreader unread badge extension for Wavebox
chrome.runtime.onMessage.addListener(async (payload, sender)=>{
if (payload.type === "setBadge") {
// Check if my message is from an app
const {isApp} = await chrome.waveboxApps.getInfo(sender.tab.id)
if (isApp) {
const count = parseInt(payload.count)
if (isNaN(count)) await chrome.waveboxApps.setBadge(sender.tab.id, {count: 0, activity: true})
else await chrome.waveboxApps.setBadge(sender.tab.id, {count, activity: false})
}
}

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
hs.hotkey.bind({}, "§", function() hs.eventtap.keyStroke({}, "`") end )
hs.hotkey.bind({ "cmd" }, "§", function() hs.eventtap.keyStroke({ "cmd" }, "`") end )
hs.hotkey.bind({ "shift" }, "§", function() hs.eventtap.keyStroke({ "shift" }, "`") end )
hs.hotkey.bind({ "cmd", "shift" }, "§", function() hs.eventtap.keyStroke({ "cmd", "shift" }, "`") end )
@mathix420
mathix420 / medium.user.js
Last active December 18, 2025 12:44
Bypass Medium Paywall - Working late 2023 - Greasy Fork, Violentmonkey, Tampermonkey - Click the RAW button to install
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 3.0
// @inject-into content
@flegfleg
flegfleg / Logseq+Hookmark.scpt
Last active October 30, 2024 09:39
Logseq Hookmark integration Applescript
-- Logseq Hookmark integration via Applescript
-- Copies Links to pages only, not blocks.
-- Paste this into Hook -> Preferences -> Scripts -> Logseq -> Get Address
tell application "System Events"
set the clipboard to ""
delay 0.5
-- You need to set a keyboard shortcut for "Copy page Url" in Logseq
-- Here: CMD + CTRL + SHIFT + U
@chrisgrieser
chrisgrieser / metadata-refactor.sh
Last active May 11, 2024 05:54
Change Wikilinks in YAML Frontmatter from the Breadcrumbs style to the new Obsidian Metadata Style
# macOS
cd "path/to/your/vault"
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md |
xargs -I {} sed -i '' -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}"
# Linux (or macOS users with GNU sed)
cd "path/to/your/vault"
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md |
xargs -I {} sed -i -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}"