Skip to content

Instantly share code, notes, and snippets.

@mevanlc
mevanlc / what_is.sh
Created September 6, 2025 23:03
what_is.sh that command?
#!/usr/bin/env bash
# what_is.sh - Inspect how Bash would resolve a command name.
# Modes:
# (A) Source to define the function: . what_is.sh
# Then use: what_is <cmd>
# (B) Source-and-run once: . what_is.sh <cmd>
# (C) Execute (cannot see live aliases/functions in this shell):
# ./what_is.sh <cmd>
what_is() {
@mevanlc
mevanlc / uninstall_bitdefender.sh
Created September 11, 2025 13:06
uninstall bitdefender
#!/bin/bash
# uninstall_bitdefender.sh
# Purpose: Remove Bitdefender Antivirus for Mac files as outlined in the vendor PDF.
# Works in Recovery mode (preferred when Finder removal fails) and can also run in normal macOS.
# Usage:
# 1) Recovery mode (recommended if Finder method failed):
# chmod +x uninstall_bitdefender.sh
# ./uninstall_bitdefender.sh --volume "Macintosh HD"
# 2) Normal mode (may fail due to protections, but safe to try):
# sudo ./uninstall_bitdefender.sh
@mevanlc
mevanlc / XML 1.0 ENBF Spec.md
Created September 12, 2025 02:47
XML 1.0 ENBF Spec

6 Notation

The formal grammar of XML is given in this specification using a simple Extended Backus-Naur Form (EBNF) notation. Each rule in the grammar defines one symbol, in the form

symbol ::= expression

Symbols are written with an initial capital letter if they are the start symbol of a regular language, otherwise with an initial lowercase letter. Literal strings are quoted.

@mevanlc
mevanlc / TextYankPost-debug.vim
Created September 14, 2025 22:54
vim TextYankPost debug
function! s:LogTextYankPost() abort
let l:logfile = expand('$HOME/.vimlog')
let l:ts = strftime('%Y-%m-%d %H:%M:%S')
let l:lines = []
call add(l:lines, '==== TextYankPost { ====')
call add(l:lines, 'timestamp: ' . l:ts)
" safe gets with defaults
let l:inclusive = get(v:event, 'inclusive', 0)
@mevanlc
mevanlc / ChatGPT_Team_uBlock_Origin_Rules.txt
Last active December 18, 2025 03:20
ChatGPT Team uBlock Origin Rules
chatgpt.com##body:xpath(//node()[.='Get started with company knowledge']/../../..)
chatgpt.com##body:xpath(//node()[@aria-label='Banner' and contains(.,'ompany knowledge')])
chatgpt.com##body:xpath(//node()[text()='Invite team members']/..)
chatgpt.com##body:xpath(//aside[contains(.,'Invite teammates')]/ancestor-or-self::div[contains(@class,'absolute')])
chatgpt.com##body:xpath(//button[.='Company knowledge'])
chatgpt.com##body:xpath(//button[@aria-label='Invite team members']/..)
chatgpt.com##body:xpath(//button[contains(.,'Company knowledge')]/..)
chatgpt.com##body:xpath(//div[starts-with(text(), "ChatGPT can make mistakes. OpenAI doesn't")])
chatgpt.com##body:xpath(//node()[name()='svg']/node()[starts-with(@d, 'M16.418 17.1669V15.7479H15C14.6327')]/ancestor::*[self::div[@data-state='closed'] or self::button])
chatgpt.com##body:xpath(//node()[name()='svg']/node()[name()='use' and contains(@href,'#edbcb1')]/ancestor::*[self::div[@data-state='closed'] or self::button])