Skip to content

Instantly share code, notes, and snippets.

View lambdalisue's full-sized avatar
🤒
I may be slow to respond.

Λlisue lambdalisue

🤒
I may be slow to respond.
View GitHub Profile
@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}"'

Keybase proof

I hereby claim:

  • I am lambdalisue on github.
  • I am lambdalisue (https://keybase.io/lambdalisue) on keybase.
  • I have a public key ASBZIH_RGffOoVv_5tfnY5LlFQR3vfTF19AiLk2543RStAo

To claim this, I am signing this object:

@lambdalisue
lambdalisue / markdown.tmpl
Last active October 8, 2021 14:55
Makrdown template of protoc-gen-doc for better looks in GitHub Pages
<details open markdown="block">
<summary>Table of contents</summary>
<ul>
<li>
<a href="#services">Services</a>
<ul>
{{- range .Files}}{{range .Services}}
<li><a href="#{{.FullName | lower | replace "." ""}}">{{.LongName}} (<code>{{.FullName}}</code>)</a></li>
{{- end}}{{end}}
</ul>