Skip to content

Instantly share code, notes, and snippets.

View Vicfred's full-sized avatar
:octocat:
I like mathemagic and computering

Vicfred Vicfred

:octocat:
I like mathemagic and computering
View GitHub Profile
@Vicfred
Vicfred / docker.md
Created October 10, 2025 15:34
docker cheat sheet

Docker

docker system df # See what's eating space

docker ps
docker ps -a
docker container ls

docker stop <container> # SIGTERM, then SIGKILL after 10s (use -t N to change)
@Vicfred
Vicfred / ebuild.md
Created August 28, 2025 23:33
Filesize does not match recorded size gentoo emerge
ebuild --force /var/db/repos/dlang/dev-util/serve-d/serve-d-0.8.0_beta18.ebuild digest
@Vicfred
Vicfred / qemu_kvm_make_conf.md
Last active July 1, 2025 07:49
qemu kvm gentoo make.conf

no need separate /boot partition for BIOS on qemu EFI requires extra work to configure on qemu, BIOS is enough

/etc/portage/make.conf

#------------------------------------------------------------------------------
# CPU & optimization flags
#------------------------------------------------------------------------------
# march=znver4      → tune for AMD Zen 4 (Ryzen 7000 series)
# O2                → safe optimization level
@Vicfred
Vicfred / dlang_binary_search_lowerbound_upperbound.md
Created June 23, 2025 05:20
d language dlang binary search lower_bound upper_bound
size_t lowerBound(long[] arr, long value)
{
  size_t first = 0;
  size_t count = arr.length;
  while (count > 0)
  {
    size_t step = count / 2;
    size_t mid  = first + step;
    if (arr[mid] < value)
@Vicfred
Vicfred / gentoo_emoji_alacritty_zsh.md
Created June 4, 2025 02:53
emoji support in gentoo alacritty zsh

✅ Step 1: Install Emoji Font

emerge media-fonts/noto-emoji

This gives you Noto Color Emoji, which supports full-color emoji rendering.


@Vicfred
Vicfred / levenshtein.md
Created April 19, 2025 17:48
levenshtein

Levenshtein Edit Distance – Dynamic Programming Walk‑through

1. State definition

dp[i][j] = minimum edits needed to change
           the first i characters of A (A[0..i‑1])
           into the first j characters of B (B[0..j‑1])
@Vicfred
Vicfred / binary_search.md
Last active April 10, 2025 09:14
binary search and variations explanation intuition

Normal binary search

function binary_search(A, n, T) is
    L := 0
    R := n − 1
    while L ≤ R do
        m := floor((L + R) / 2)
        if A[m] < T then // everything on the left is less, move right, i.e., delete left
            L := m + 1
 else if A[m] &gt; T then // everything on the right is more, move left, i.e., delete right
@Vicfred
Vicfred / rsync_flatnotes.md
Last active March 29, 2025 22:23
rsync_flatnotes
rsync -avzh --progress --prune-empty-dirs --delete --include "*/"  --include="*.md" --include="*.jpg" --include="*.png" --exclude="*" [email protected]:flatnotes/data/ ~/src/noto/notes
@Vicfred
Vicfred / coc_vim_nim_gentoo.md
Last active May 8, 2025 07:57
configure autocomplete for nim vim coc on gentoo

Install nim with choosenim

curl https://nim-lang.org/choosenim/init.sh -sSf | sh

Install nimlsp

nimble install nimlsp
@Vicfred
Vicfred / coc_vim_dlang_gentoo.md
Last active June 4, 2025 03:42
configure autocomplete for d dlang vim coc on gentoo

enable dlang overlay

emerge --ask --noreplace app-eselect/eselect-repository dev-vcs/git
eselect repository enable dlang
emerge --sync dlang

Install dmd, dlang-tools, serve-d, dub, dcd

emerge -av dev-lang/dmd dev-util/dlang-tools dev-util/dcd dev-util/dub dev-util/serve-d