This code snippet is a simple FastAPI application that manages a background job with status.
pip install fastapi uvicorn
| ---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) |
| #!/usr/bin/env bash | |
| # | |
| # Install wrong architecture packages on macOS | |
| # - Can only install one package at a time, unless using "brew bundle" | |
| # - Uses `brew deps --tree` to loop over dependencies | |
| # - For speed, tries to NOT upgrade a package automatically | |
| # - To upgrade a package, use wrongbrew.sh uninstall <packagename> && wrongbrew.sh install <packagename> | |
| # - Based on the example from @maxirmx https://stackoverflow.com/a/70822921/3196753 | |
| # Halt on first error |
| #!/usr/bin/env python | |
| # ------------------------------------------------------------------ | |
| # Script Name: showipaddr.py | |
| # Description: A Python Script to display Private and | |
| # Public IP address details in Linux and Unix. | |
| # Website: https://gist.github.com/ostechnix | |
| # Version: 1.0 | |
| # Usage: python showipaddr.py | |
| # ------------------------------------------------------------------ |
Some notes, tools, and techniques for reverse engineering macOS binaries.
Some notes and references while exploring the GitHub CLI extension for the GitHub Copilot CLI.
| import requests | |
| from requests.adapters import HTTPAdapter, Retry | |
| def get_vscode_extensions(max_page=10000, page_size=100, | |
| include_versions=True, include_files=True, include_category_and_tags=True, include_shared_accounts=True, include_version_properties=True, | |
| exclude_non_validated=False, include_installation_targets=True, include_asset_uri=True, include_statistics=True, | |
| include_latest_version_only=False, unpublished=False, include_name_conflict_info=True, api_version='7.2-preview.1', session=None): | |
| if not session: | |
| session = requests.session() |
| /** | |
| * Module of frequently used functions in [Obsidian-RunJS]{@link https://github.com/eoureo/obsidian-runjs}. | |
| * | |
| * @RunJS RunJS/Utils | |
| * | |
| * modified: 2023-07-13 19:35:07 | |
| * | |
| * async function replaceSelection(app, substr = "", substr_new = "") | |
| * async function getSelection(app) | |
| * async function setSelection(app, text) |