Skip to content

Instantly share code, notes, and snippets.

View lambdalisue's full-sized avatar
🫠
Melting

Λlisue lambdalisue

🫠
Melting
View GitHub Profile
@lambdalisue
lambdalisue / add-icon-padding.py
Created December 20, 2025 15:36
Add transparent padding to an icon for macOS Tahoe compatibility
#!/usr/bin/env python3
"""
Add transparent padding to an icon for macOS Tahoe compatibility.
macOS Tahoe automatically adds white borders to icons that extend to the edge.
This script adds transparent padding around the icon to prevent this behavior.
Usage:
python3 add-icon-padding.py input.png output.png [--padding 12]
# Scroll
map <c-y> scrollUp
map <c-e> scrollDown
# Scroll more
unmap u
unmap d
map <c-u> scrollPageUp
map <c-d> scrollPageDown
@lambdalisue
lambdalisue / obsidian.json
Created September 5, 2024 08:24
Karabiner Element Complex modification for Obsidian
{
"title": "Obsidian",
"rules": [
{
"description": "Send Escape twice on Escape",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
@lambdalisue
lambdalisue / .obsidian.vimrc
Last active December 4, 2024 03:28
Obsidian vimrc
" https://github.com/esm7/obsidian-vimrc-support
nmap j gj
nmap k gk
nmap ; :
set clipboard=unnamed
" Enable Emacs-like mappings in Insert/Command Mode
" It seems simple mappings doesn't work in 'imap' so some workaround is
@lambdalisue
lambdalisue / english-word-length-frequency.ts
Last active August 27, 2024 10:10
English word length frequency
import { exists } from "jsr:@std/fs";
import { map, reduce } from "jsr:@core/iterutil";
const sourceUrl =
"https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt";
const filename = "words_alpha.txt";
if (!(await exists(filename))) {
const resp = await fetch(sourceUrl);
await Deno.writeFile(filename, resp.body!);
@lambdalisue
lambdalisue / aerospace.toml
Last active August 20, 2024 05:22
Float window and re-positioning the window to the center of monitor on Aerospace
[exec]
inherit-env-vars = true
[exec.env-vars]
XDG_CONFIG_HOME = '${HOME}/.config'
#...
alt-period = '''exec-and-forget
aerospace layout floating \
@lambdalisue
lambdalisue / unknownutil-v3-to-v4-migration.ts
Last active August 3, 2024 05:54
unknownutil v3 to v4 migration
import { walk } from "jsr:@std/fs/walk";
const version = "^4.0.0";
function migrate(text: string): string {
text = text.replace(
/import(\s+){(.*?)}(\s+)from(\s+)"jsr:@core\/unknownutil@\^?3.*?"/sg,
`import$1{$2}$3from$4"jsr:@core/unknownutil@${version}"`,
);
text = text.replace(/is\.RecordLike/g, "is.Record");
@lambdalisue
lambdalisue / config.py
Created October 14, 2023 13:22
Keyhac
import sys
import os
import datetime
import pyauto
from keyhac import *
def configure(keymap):
# Setting with callable object (Advanced usage)
@lambdalisue
lambdalisue / bookmarklet
Last active January 13, 2023 05:25
Docbase で記事幅をウィンドウ幅に合わせるブックマークレット
javascript:(function() {
const t = document.querySelector('.c-MainLayout_Content article div');
t.style.maxWidth = "none";
t.style.width = "99%";
}())
@lambdalisue
lambdalisue / test.sh
Created October 13, 2022 04:53
Bash test difference (-z/-n)
check() {
# -z: True when the string length is 0
if [ -z $DUMMY ]; then
echo '-z $DUMMY'
fi
if [ -z "$DUMMY" ]; then
echo '-z "$DUMMY"'
fi
if [ -z "${DUMMY+xxx}" ]; then
echo '-z "${DUMMY+xxx}"'