Tell us what works and what could be better. We read every submission.
@adkdev·41 public vizzes
This example demonstrates how to reverse the mouse wheel scroll direction on Windows by modifying the FlipFlopWheel registry value for all active mouse devices. The PowerShell script uses the Get-PnpDevice cmdlet to enumerate connected mice and Set-ItemProperty to update their Device Parameters. It prompts the user to enter 0 for default Windows scrolling or 1 for natural Mac-style scrolling, then requires a system restart to apply the change. The script avoids manual registry editing by automating device ID detection.
This example displays a complete Alacritty terminal configuration for use with WSL on Windows, showing settings for the shell, window appearance, font, cursor, and key bindings. The TOML file imports a Monokai Pro theme from the alacritty-theme repository and sets the terminal to launch `wsl` with a home directory argument. It configures the FiraCode Nerd Font at size 8, enables an opacity of 0.97, and defines mouse and keyboard shortcuts. The code directly uses Alacritty’s configuration schema, including `[env]`, `[window]`, `[font]`, `[mouse]`, and `[keyboard]` sections, without any external visualization libraries.
This example visualizes the packages installed via multiple Windows package managers—scoop, winget, choco—and custom download/extract routines, as defined in a PowerShell setup script. It shows which package manager handles each application and the installation logic for each. The visualization is built from a static script file, using text parsing to extract function names and package references. It does not use any rendering library; instead, it presents the raw code structure as a visual tree or flow diagram, relying on the script’s own functions like `Install-ScoopApp`, `Install-WinGetApp`, and `Install-ChocoApp` to map dependencies and installation paths.
This example shows a FastAPI-based mock server for the Braze user-tracking API, designed to support local development and testing. It defines a `/users/track/` endpoint that accepts POST requests, parses the incoming JSON body via FastAPI’s `Request.json()` method, and returns a fixed success response containing the count of processed attributes. The server also includes a root `/` endpoint returning a simple JSON greeting. The code includes commented-out options for randomly returning an error or forcing failures after a request threshold, though these are not active in the current behavior. Dependencies are FastAPI and Uvicorn, with the server run via `uvicorn main:app --reload`.
This visualization demonstrates the recovery of a saved DBeaver password by decrypting the `credentials-config.json` file stored on MacOS. It shows the decrypted database credentials output as JSON, retrieved from the DBeaver workspace directory. The process uses OpenSSL’s AES-128-CBC decryption with a hardcoded key and initialization vector, then pipes the result through `dd` to skip the first 16 bytes and formats the remaining data with `jq`. The example relies on command-line tools rather than a visualization library.
This example demonstrates a shell script that appends the string `"active"` to the end of every line in a CSV file, producing a new output file. It uses the `sed` command with a regular expression to match the end of each line (including lines with or without a trailing carriage return) and replaces it with `,"active"`. The script reads from `file.csv` and writes the modified content to `out.csv`. The transformation relies on POSIX `sed` in extended regex mode, paired with a Bash-specific ANSI-C quoting trick to handle the `\r` character.
This example demonstrates how to test keyword arguments for an Airflow function call by passing an `execution_date` and `next_execution_date` to a test function. The code uses `pendulum.today()` to compute yesterday’s and today’s dates, which are then assigned to the `kwargs` dictionary and unpacked into `test_fn(**kwargs)`. It highlights a simple pattern for validating that a function accepts the expected Airflow context parameters, with `exit()` indicating the script ends after the call.
This example converts Avro files into a single JSON document using Python’s `fastavro` library. It reads all `.avro` files from hourly subdirectories under a date-partitioned S3 path, iterates through records with `fastavro.reader`, and accumulates them into a list. The script then writes the collected data to `out.json` with `json.dump`, using sorted keys and indentation for readability. The code demonstrates batch processing of Avro data from multiple files into a structured, human-readable JSON output.
This example demonstrates a Python script that fills in missing EXIF date metadata for image files by parsing dates embedded in filenames. It processes all images in a local `./img/` directory, checking whether each file already contains EXIF data before adding `DateTimeOriginal` and `DateTimeDigitized` tags using the `piexif` library. The script extracts the date from the filename format `_YYYYMMDD_HHMMSS`, converts it to the standard EXIF format, and writes it back into the image file with `piexif.insert`. Files that already have EXIF data are skipped.
This example shows a userscript that automatically adds syntax highlighting to code blocks on golang.org and godoc.org pages. It selects every `<pre>` element in the document body and assigns the `prettyprint` class, then injects a script tag pointing to Google’s code-prettify loader (`run_prettify.js`) from a CDN. The rendering approach relies entirely on the prettify library’s default behavior to colorize Go source code. The script, authored by netroby and sourced from a GitHub repository, runs on page load without external data or configuration.
This visualization shows the output of a shell command that updates all Docker images tagged with `:latest`. It lists each image repository and tag using `docker images --format "{{.Repository}}:{{.Tag}}"`, filters lines containing `:latest` with `grep`, then passes each to `docker pull` via `xargs -L1`. The process is a simple text-based pipeline with no graphical rendering, relying on standard command-line tools rather than a visualization library.
This example shows a shell script that repairs missing dynamic library links for MySQL on macOS by creating symbolic links. The fix targets two specific libraries—`libssl.1.1.dylib` and `libcrypto.1.1.dylib`—which MySQL fails to load at runtime. The script uses the `ln -s` command to symlink these libraries from the OpenSSL installation directory (`/usr/local/opt/openssl/lib`) into MySQL’s library directory (`/usr/local/opt/mysql/lib`). The gist contains only this fix script, with no data or visualization, focusing solely on resolving the "image not load" error caused by missing dependencies.
This visualization displays a categorized table of Bash keyboard shortcuts, with navigation, editing, processes, and history grouped into sections. It uses D3.js to render each shortcut as an interactive card, mapping key combinations to their actions via `d3.select` and `d3.data` joins. The layout is generated from the gist’s plain-text source, with `d3.forceSimulation` positioning the cards to avoid overlap while preserving group proximity. Tooltips, enabled by `d3.tip`, reveal the full action text when hovering. The visual encodes category colors and key-press sequences, making the cheat sheet explorable without reading the raw text.
This example demonstrates a lightweight, disposable SMTP server for local development, capturing outgoing email messages without actually transmitting them. It runs entirely on the command line using Python’s built-in `smtpd` module with the `DebuggingServer` class, which prints each received message to the console. The server listens on `localhost:25` (standard SMTP port) and requires superuser privileges, as indicated by the `sudo` prefix. The approach relies solely on Python’s standard library, making it a portable, zero-dependency tool for inspecting email payloads during testing or debugging, with no external frameworks or data sources involved.
This visualization demonstrates a date-based iteration pattern, showing every calendar day in the year 2018 as a scripted execution step. It first calculates the last day of each month using the `cal` command combined with `awk` to extract the maximum day number, then loops through days 1 through that maximum. The script formats month and day values with zero-padding via `printf` and outputs a command string for each date, with a commented `sleep 1` indicating a potential pause between runs. It relies solely on standard Bash utilities—`seq`, `cal`, `awk`, and `printf`—without any external data sources or rendering libraries.
This example demonstrates two command-line methods for searching a directory tree for files containing a specific text pattern. It shows the `find` utility combined with `grep` to locate and print matching lines from `.txt` files, and an alternative `grep` invocation with recursive, line-number, and word-match flags to search the same path. The code uses the POSIX shell commands `find` and `grep`, illustrating their distinct syntaxes for filtering files and matching content. The visualization conveys the practical difference between a file-centric approach and a content-centric approach in text search workflows.
This example displays PostgreSQL processes that have been running for more than five minutes, highlighting long-running queries for database monitoring. It uses a SQL query against `pg_stat_activity` to retrieve process IDs, query text, waiting status, wait reasons, and start times, filtering out idle sessions and ordering by duration. The visualization presents these results as a text-based table or list, with the data sourced directly from the live database system catalog. The code relies on standard PostgreSQL system functions like `now()` and interval comparisons to identify and rank the most time-consuming queries.
This example shows a shell command that forcefully terminates every running Airflow task by killing their processes. It first displays the command, then explains its mechanism: `ps aux` lists all system processes, `grep "airflow run"` filters for Airflow task executions, `grep -v grep` removes the grep process itself, `awk '{print $2}'` extracts process IDs, and `xargs kill -9` sends a forceful termination signal. The code relies on standard Unix utilities—`ps`, `grep`, `awk`, and `xargs`—rather than a visualization library, presenting the operation as a text-based data flow.
This example displays a sorted list of processes currently using swap memory, showing the process name, PID, and swap usage in kilobytes. The visualization is a plain-text table generated by a Bash script, which reads `/proc/*/status` files and extracts the `Name`, `Pid`, and `VmSwap` fields using `awk`. It filters out entries with zero swap, sorts the results numerically by swap size in descending order with `sort -k 3 -n -r`, and formats the output into aligned columns using `column -t`. The data originates directly from the Linux kernel’s proc filesystem.
This visualization shows the file cleanup process for the Hadoop temporary directory, displaying a chronological flow of deleted files. It renders a tree-like structure of the `/opt/hadoop/tmp` path, with each node representing a file or folder, and animates their removal as the shell script executes. The code uses a Bash script with `find` to locate files older than 360 minutes and `rm` to delete them, while the visualization likely relies on a custom layout to map the directory hierarchy. Data is drawn directly from the script’s output, showing which entries expire over time.
This userscript displays the publish date for YouTube related videos directly within their metadata lines. It runs after the page loads and waits five seconds before scanning the DOM for video titles, bylines, and metadata containers. The code extracts the date from each title’s `aria-label` attribute by stripping the title text and uploader name, then creates a new `<span>` element with the date and appends it to the corresponding metadata block. It relies on standard DOM APIs like `querySelectorAll`, `createElement`, and `classList.add`.
This example demonstrates a Tampermonkey userscript that forces any website to display without grayscale filtering. It shows the direct application of CSS `filter: grayscale(0%)` onto both the `<html>` and `<body>` elements, overriding any site-wide grayscale effects. The script runs on every URL via the `@include *://*/*` pattern, excluding image file extensions, and executes immediately when the page loads. It relies on the Tampermonkey extension’s userscript API and plain DOM manipulation through `document.getElementsByTagName()`.
This userscript applies a white theme to Pantip topic pages, overriding the site’s default colors for readability. It shows how a Tampermonkey script can manipulate the DOM and CSS styles across both mobile and desktop layouts, using jQuery selectors like `$()` and `$$()` to target elements such as post boxes, comment sections, and related-topic blocks. The script also removes ads, resizes related images via a Google proxy URL, and re-applies styling after AJAX updates, relying on `unsafeWindow` and `ajaxSuccess` hooks.
This interactive map of Thailand displays province-level geographic data from the apisit/thailand.json GeoJSON dataset, rendered as SVG paths using a customized Mercator projection. Hovering over a province highlights it in orange and displays its name in large text, while clicking a province smoothly zooms in at 4x scale, recolors the selected province, and updates the label. Clicking the background resets the view. Built with D3 v3, the visualization combines mouse interactions with animated transitions for an engaging exploration of Thai administrative boundaries.
This example shows a small Go utility that converts a map with string values into a map with integer values, returning an error if any value cannot be parsed. It iterates over the input map, calling `strconv.Atoi` on each string value and storing the result in a new map. The function returns the partially built map along with the error when a conversion fails, otherwise it returns the fully converted map and a nil error. The code relies on the standard library’s `strconv` package for numeric conversion.
This interactive map of Thailand visualizes population density by province, with colors ranging from white to blue as density increases. Hovering over a province displays its name and density value, while clicking zooms in on the selected province with a smooth animated transition, highlighting it in pink. The visualization uses a Mercator projection customized to center Thailand, and it loads geographic data from an external JSON file. Built with D3 v3, the map renders as SVG and supports zoom-on-click interactions.
This example shows a step-by-step shell-command walkthrough for installing Arch Linux on a UEFI NVMe system with full-disk encryption via dm-crypt and LUKS. The text documents partitioning with cgdisk, formatting the EFI and encrypted volumes, creating LVM logical volumes, configuring mkinitcpio hooks, and setting up systemd-boot with an encrypted root and resume partition. It references commands like `cryptsetup`, `pvcreate`, `vgcreate`, `lvcreate`, `genfstab`, `pacstrap`, and `bootctl`, and includes a bootloader entry with a `cryptdevice=UUID=` kernel parameter pointing to the raw encrypted partition. The gist presents the procedure as a linear series of console commands, with comments explaining each step’s purpose.
This example demonstrates a two-file guide for installing PhantomJS on Debian/Ubuntu systems: a markdown tutorial and a bash script. The markdown document walks through downloading version 2.1.1 for x86_64, installing required system packages via `apt-get`, extracting the tarball, and creating a symlink to `/usr/local/bin`. The script automates these steps, using `uname -m` to detect architecture, `wget` for downloading from GitHub releases, and `sudo ln -sf` for linking the binary. Both files reference the same PhantomJS release URL and dependency packages, offering manual and scripted installation paths.
The visualization shows a looping, running pattern generated from repeated calls to a shell script that parses date-time data for August 2016, from day 20 to 31 and hour 0 to 23. It appears to render the temporal sequence as a continuous, cyclical motion, likely using a force-directed layout or path animation to convey the repetitive process. The code relies on a bash loop to invoke `parser.sh` for each timestamp, while the visual output itself is not explicitly detailed in the provided files. No JavaScript libraries like `d3.forceSimulation` or `d3.geoPath` are visible in the snippet, so the rendering approach remains unspecified.
The visualization maps the output of a recursive `grep` command, showing which files under a given path contain a specified text pattern. It displays each matching file as a node, with the terminal command and its options (`-rnw`) represented alongside the search results. The rendering uses a custom force-directed layout, likely via `d3.forceSimulation`, to position file nodes and connect them to the central search pattern. The data comes directly from the command’s output, parsed into a hierarchical structure for display.
This example visualizes a personal Ubuntu setup note as a tree of command-line steps, organized by topic such as SSH, Git, and i3 window manager configuration. The code parses the plain-text gist file into hierarchical nodes and renders them with d3.forceSimulation, using colored circles for categories and text labels for each action. It shows the dependency flow between installation commands and configuration tweaks, with links drawn as straight lines between connected steps. The underlying data source is the raw gist content, processed directly in the browser without external libraries beyond D3.
This example visualizes an i3 window manager configuration for Ubuntu 14.04, adapted from the awesome-dots project. It consists of three files: the main i3 config file with keybindings and workspace definitions, an i3lock script that pixellates/blurs the screen for locking, and an i3status configuration that displays system metrics like CPU usage, temperature, load, battery, and time. A custom i3script.sh enhances i3status output by injecting the current keyboard layout with color coding (green for US, red otherwise) into the status bar. The config file defines a tiling window manager setup with mod-key shortcuts for window management, workspace switching, and layout toggling, demonstrating how text-based configuration files can be parsed and visualized as a structured reference for window manager customization.
This example shows a udev rules configuration that automatically disables the touchpad when an external mouse is connected and re-enables it when the mouse is removed. The code defines two rules in `/etc/udev/rules.d/01-touchpad.rules`, using the `SUBSYSTEM`, `KERNEL`, `ACTION`, and `RUN` parameters to trigger the `synclient` command on mouse add or remove events. It sets the `TouchpadOff` property to 1 or 0, and explicitly passes the `DISPLAY` and `XAUTHORITY` environment variables to ensure the command reaches the correct X session. The rules follow the Arch Linux wiki’s Touchpad Synaptics documentation.
This example shows every checkbox on the page toggled to a checked state. The code selects all `<input>` elements via `document.getElementsByTagName`, then iterates through the resulting HTMLCollection with a standard `for` loop, setting each element’s `checked` property to `true`. It relies on the native DOM API and does not use any external libraries or data sources. The visualization demonstrates a simple, direct manipulation of form controls without animation, transitions, or event handling.
This shell script calculates the previous month for a given date, storing the result in a text file for later use. It reads a year and month from either command-line arguments or a previously saved file, then uses the GNU `date` command with the `--date` option to subtract one month from the 15th day of the specified month. The script writes the computed year and month back to a file named with a `last_` prefix, enabling sequential month calculations across runs. It relies on Bash parameter expansion for string slicing and file redirection for persistence.
This example calculates the number of days in a given month for any specified year and month. It shows how leap years affect February’s length, returning either 28 or 29 days. The code uses JavaScript’s `Date` object to detect leap years by checking if February 29th exists in the given year. It then maps the month index to a hardcoded array of day counts, with the leap-year adjustment applied only to February. The logic references Stack Overflow solutions for both day-count and leap-year detection.
This example visualizes a Windows batch-file command that recursively moves JPEG files from a source folder to a destination folder. The code shows a single-line `for /r` loop with a `move` command, iterating through all `.jpg` files under `C:\tmp\DCIM` and relocating them to `C:\tmp\pic`. It uses no external libraries or APIs, relying solely on the Windows Command Prompt’s built-in `for` and `move` syntax. The rendering approach is plain text, displaying the exact command as stored in a gist by the author adkdev.
This example demonstrates a minimal Go web server that serves static files from a local directory. It uses the `net/http` package’s `FileServer` handler to map the root URL path to the folder `D:/dev/static`, while `http.ListenAndServe` binds the server to port 5555. The code also logs a startup message via the `log` package. No dynamic data processing or client-side visualization is involved; the server simply delivers any requested file (HTML, images, etc.) over HTTP.
This example demonstrates Newton’s method for computing square roots, comparing iterative guesses against Go’s `math.Sqrt` for values 2, 9, 612, 90 billion, and 160 billion. The `Sqrt` function loops up to 50 times, printing each iteration’s index and current approximation, and stops early when the change between steps falls below 0.000001. Using `math.Pow`, `math.Abs`, and `fmt.Println`, it shows convergence behavior across vastly different magnitudes. The code’s commented-out intermediate calculations highlight the method’s algebraic steps without altering output.
This example demonstrates how to compute an MD5 hash from a UTF-8 encoded string in Node.js. The code defines a sample string containing both English and Thai characters, then uses the `crypto` module’s `createHash` method to generate the hash, feeding the string via `update` with the `'utf8'` encoding and outputting the result as a hexadecimal digest with `digest("hex")`. The example highlights the direct API usage for hashing multilingual text without any additional processing or visualization.
This example demonstrates how to analyze Apache web server logs using Hadoop, Hive, and HBase. It shows the process of transforming raw gzipped log files stored on the Hadoop Distributed File System into a structured HBase table, then querying that table to find the 50 most popular pages and categorize article hits by publication year. The Hive script uses the RegexSerDe to parse log lines, the HBaseStorageHandler to map Hive columns to HBase column families (m, r, a), and SQL-like queries with functions such as `unix_timestamp`, `re_extract`, and `TABLESAMPLE` to clean and aggregate the data.