Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# WAYBAR CPU MODULE
# ----------------------------------------------------------------------------
# CPU monitoring script for waybar.
# Features:
# - Per-core usage visualization (Die layout)
# - Power usage (RAPL)
# - Temperature monitoring
# - Top processes consuming CPU
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# WAYBAR MEMORY MODULE
# ----------------------------------------------------------------------------
# A dynamic memory monitor for Waybar.
# Features:
# - Real-time RAM usage with color-coded states
# - Tooltip with detailed breakdown (Used, Cached, Buffers)
# - Auto-detects memory modules via dmidecode (requires sudo permissions)
# - Temperature monitoring (requires lm_sensors)
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# WAYBAR GPU MODULE
# ----------------------------------------------------------------------------
# Visualizes GPU stats including VRAM layout and Die temperature.
# Designed for Nvidia GPUs (uses nvidia-smi).
# ----------------------------------------------------------------------------
import json
import subprocess
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# WAYBAR STORAGE MODULE
# ----------------------------------------------------------------------------
# Auto-detects mounted physical drives and displays usage in a sleek dashboard.
# Features:
# - Dynamic drive detection (ignores snaps, loops, etc.)
# - Real-time I/O speeds (Read/Write)
# - Drive temperature monitoring (requires lm_sensors/smartctl)
# - Health status via smartctl (requires sudo)
@MariaSolOs
MariaSolOs / builtin-compl.lua
Last active April 17, 2026 15:23
Built-in completion + snippet Neovim setup
---Utility for keymap creation.
---@param lhs string
---@param rhs string|function
---@param opts string|table
---@param mode? string|string[]
local function keymap(lhs, rhs, opts, mode)
opts = type(opts) == 'string' and { desc = opts }
or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr })
mode = mode or 'n'
vim.keymap.set(mode, lhs, rhs, opts)
@Pagliacii
Pagliacii / neovim-as-merge-tool.md
Last active April 29, 2026 13:13
Using Neovim as a merge tool

git

Using diffview.nvim

# ~/.gitconfig
[merge]
  tool = diffview
[mergetool]
  prompt = false
@VPraharsha03
VPraharsha03 / kitty-in-wsl2.md
Last active May 12, 2026 18:31 — forked from Mluckydwyer/opengl-in-wsl.md
Install kitty on Ubuntu in WSL2

How to Install kitty in Ubuntu in WSL2

These seteps have been tested on Windows 10 with WSL2 running Kali Linux.

1. Dependencies

First install the dependencies:

Install OpenGL

apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
@sts10
sts10 / rust-command-line-utilities.markdown
Last active June 15, 2026 01:18
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@mafintosh
mafintosh / promise-unhandled-why.js
Last active March 30, 2022 06:30
promise-unhandled-why.js
start()
async function start () {
const promises = [
new Promise((resolve, reject) => setTimeout(reject, 1000)),
Promise.reject(),
Promise.reject()
]
for (const a of promises) {