Skip to content

Instantly share code, notes, and snippets.

Parsing code --status into Clean JSON: A Simple Script Explained

This Python script turns the fairly human-oriented output of code --status (from Visual Studio Code) into a structured JSON object that tools can consume. It works on Windows, macOS, and Linux, and it can either read the code --status text from standard input or execute the command itself if no input is provided.

What the script does

  1. Input handling

    • If data is piped in (code --status | python parse_vscode_status.py), it uses that.
  • If not, it runs code --status via subprocess. On Windows, it tries multiple decoders (utf-8, cp932, mbcs) and falls back to a replacement strategy to avoid crashes from encoding issues.

Articles and Threads That Actually Operate or Test explorer.exe Windows and Tabs Using SendMessage / PostMessage

This collection gathers articles and threads—mainly in Japanese, but also with technically substantial English content—that explore or verify direct manipulation of File Explorer (explorer.exe) windows or “tabs” through Windows messaging (SendMessage, PostMessage).

Articles Testing “Open New Tab” with SendMessage

  • Stack Overflow: “Opening Folder in New Tab of Existing Shell Window” Clearly states that sending the undocumented WM_COMMAND 0xA21B (41499) to ShellTabWindowClass in Windows 11’s Explorer opens a new tab. Provides both a UI Automation approach and an example of SendMessage(hwnd, WM_COMMAND, 0xA21B, 0), complete with technical reasoning and code. ([Stack Overflow][1])

ActivateHwnd: A Tiny Utility to Focus Any Window by Handle

This small C++ program, ActivateHwnd.exe, brings an existing Windows GUI window to the foreground when you provide its window handle (an HWND) on the command line. It accepts either hexadecimal (e.g., 0xABC) or decimal (e.g., 12345) formats and uses several Win32 APIs to restore, raise, and focus that window as reliably as possible.

What the Program Does

  1. Parses the handle you pass in. The function ParseHwnd trims whitespace, detects whether the input is hex or decimal (by checking for 0x/0X or A–F digits), and converts it to an integer. It then casts that value to an HWND. Invalid formats are rejected early with a clear error.

  2. Validates the target window.

@aont
aont / 0 Getting the Touch Bar Working on Ubuntu MacBook Pro 2017.md
Last active November 4, 2025 07:41 — forked from almas/ubuntu-on-mbp-a1707.md
Ubuntu LTS on MacBook Pro 2017 (A1707, MBP 14,3)(T1 chip)

Getting the Touch Bar Working on Ubuntu (MacBook Pro 2016/2017)

This note extracts just the Touch Bar piece from a longer guide and adds that I also confirmed it works on MacBookPro14,2 (13-inch, 2017)—not only on 14,3. Everything below is in English as requested.


What this enables

  • Touch Bar (including Esc/Function layer) working on Ubuntu 22.04 LTS (and after upgrading to 24.04 LTS) on:

Getting Wi-Fi Working on a MacBook Pro (mbp14,2) After Installing Ubuntu

If you’ve installed Ubuntu on a 13-inch MacBook Pro (2017, model mbp14,2) and the Wi-Fi isn’t recognized, don’t worry—this model uses a Broadcom chip that needs a small configuration nudge. Below is a simple, step-by-step guide to bring your wireless back to life.


What You’ll Do (Overview)

  1. Copy a known-good firmware configuration file for the Broadcom card.
  2. Set your wireless regulatory domain to Japan (JP) so channels work correctly.

mbp14-2 Wi-Fi nvram

Changing the Startup Menu Item Name on macOS

If you dual-boot or keep multiple macOS installations on one Mac, it’s handy to give each startup entry a clear, human-friendly name. Below is a simple guide to rename what appears in the macOS Startup Manager (the screen you get by holding Option/⌥ at boot).

What you’ll do

You’ll set a visible label for a macOS system folder using bless, and (optionally) edit the detailed disk label file used by macOS.

⚠️ You’ll need administrator rights. Be careful with commands that use sudo.

Forcing Consistent Colors in tmux (Regardless of Your Terminal Theme)

When you switch terminal themes, your prompt and UI colors might change—unless you tell tmux exactly which colors to use. tmux lets you bypass theme-dependent names like red or blue and instead target fixed palette indexes (or even truecolor) so your status bar and panes look the same everywhere.

The idea

Use numeric color indices (or RGB) instead of theme names. In tmux, that means:

  • colourN for the 256-color palette (0–255)
  • #RRGGBB for truecolor (24-bit), if your terminal supports it

Two Handy Python Tools to Inspect and Clean VS Code Workspaces

If you use Visual Studio Code a lot, the workspaceStorage folder can fill up with old entries. The two scripts below help you (1) list everything that’s there and (2) safely delete one workspace’s metadata by its ID.


What the tools do

1) List all workspace IDs and URIs (cross-platform)

Toggle Windows “Transparency Effects” from PowerShell

When Windows’ Transparency effects are on, right-click menus and other UI surfaces use an acrylic, grayish, semi-transparent background. Turning transparency off restores an opaque (often white) background. You can switch this setting directly from PowerShell by editing the same registry value the Settings app controls.

Check the current setting

Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" |
  Select-Object EnableTransparency