Skip to content

Instantly share code, notes, and snippets.

View YDX-2147483647's full-sized avatar
🏠
啊啊啊——!

Y.D.X. YDX-2147483647

🏠
啊啊啊——!
View GitHub Profile
@YDX-2147483647
YDX-2147483647 / change-powershell-colors.md
Created January 15, 2023 07:23
You can change colors in PowerShell / Windows Terminal.

The default colors in PowerShell (or Windows PowerShell) can be unreadable / boring.

Example: If you use a black background and type pip --version, then --version will be BrightBlack and fade into the background.

There are many ways to change that.

  • Windows Terminal

    The shell only determines color names (e.g. BrightBlack), and it is the terminal who decides real colors (e.g. #767676).

@YDX-2147483647
YDX-2147483647 / batman-pwsh.md
Last active December 24, 2023 09:24
Help or see manual with bat.

Help or see manual with bat.

Add the following to your PowerShell $PROFILE, and try batman pip install.

<#
.SYNOPSIS
    Help or see manual with bat

.NOTES
#!/bin/bash
status=`bitsrun status --json | jq '.error' --raw-output`
if [[ $status != 'ok' ]]; then
echo "Status: $status. Relogin…"
bitsrun logout
bitsrun login
fi
@YDX-2147483647
YDX-2147483647 / mkdocs-tasks.json
Created July 18, 2023 13:31
VS Code `tasks.json` for mkdocs serve with a problem matcher
{
"version": "2.0.0",
"tasks": [
{
"label": "Serve",
"command": "mkdocs",
"type": "process",
"args": [
"serve",
],
@YDX-2147483647
YDX-2147483647 / submit-educg.sh
Last active September 4, 2023 12:33
提交作业到 course.educg.net
#!/usr/bin/env bash
set -euo pipefail
help() {
cat <<'EOF'
提交作业到 course.educg.net
Usage
submit PROBLEM_ID ASSIGN_ID FOLDER
@YDX-2147483647
YDX-2147483647 / get-changelog-scoop.md
Last active December 24, 2023 10:23
Get changelog of an app in scoop.

This is a simple script to get changelog of an app in scoop. It fetches changelog from GitHub releases or CHANGELOG.md.

Add the following to your PowerShell $PROFILE, and try Get-Changelog <App>.

<#
.SYNOPSIS
    Get changelog of an app in scoop
.NOTES
    Prerequisites:
@YDX-2147483647
YDX-2147483647 / tlmgr-pkg.md
Last active July 10, 2024 14:14
(La)TeX packages installed by tlmgr (TeX Live Manager).

tlmgr packages

(La)TeX packages installed by tlmgr (TeX Live Manager).

Based on minimal.

Collections

collection-bibtexextra
@YDX-2147483647
YDX-2147483647 / typst-equation-numbering-rules.typ
Last active April 27, 2024 02:58
Make equations numbered by chapters in Typst.
/// Make equations numbered by chapters (heading level 1)
///
/// Only works if headings are numbered.
///
/// # Usage
///
/// ```
/// #show: equation-numbering-rules
/// #set heading(numbering: "1.")
///
@YDX-2147483647
YDX-2147483647 / podcast-ffprobe.md
Created July 5, 2024 06:23
Extract chapters from an audio using ffprobe.

Extract chapters from an audio using ffprobe.

Basic example

$ curl -LO https://static.thetype.cloud/typechat/typechat157.mp3
$ ffprobe typechat157.mp3
…
  Metadata:
    album           : 字谈字畅