Useful snippets

    Bootstrap margin & padding (spacing)

    Tue 03. June 2025 | 2025-06-03

    Spacing utilities that apply to all breakpoints, from xs to xxl, have no breakpoint abbreviation in them. This is because those classes are applied from min-width: 0 and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.

    The classes are named using the format {property}{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, xl, and xxl.

    Where property is one of:

    • m - for classes that set margin
    • p - for classes that set padding

    Where sides is one of:

    • t - for classes that set margin-top or padding-top
    • b - for classes that set margin-bottom or padding-bottom
    • s - (start) for classes that set margin-left or padding-left in LTR, margin-right or padding-right in RTL
    • e - (end) for classes that set margin-right or padding-right in LTR, margin-left or padding-left in RTL
    • x - for classes that set both *-left and *-right
    • y - for classes that set both *-top and *-bottom blank - for classes that set a margin or padding on all 4 sides of the element

    Where size is one of:

    • 0 - for classes that eliminate the margin or padding by setting it to 0
    • 1 - (by default) for classes that set the margin or padding to $spacer * .25
    • 2 - (by default) for classes that set the margin or padding to $spacer * .5
    • 3 - (by default) for classes that set the margin or padding to $spacer
    • 4 - (by default) for classes that set the margin or padding to $spacer * 1.5
    • 5 - (by default) for classes that set the margin or padding to $spacer * 3
    • auto - for classes that set the margin to auto

    (You can add more sizes by adding entries to the $spacers Sass map variable.)

    https://getbootstrap.com/docs/5.3/utilities/spacing/#notation

    Vim registers

    Fri 16. May 2025 | 2025-05-16

    Yank / delete to 's' register

    prepend with "s

    yank

    "sy*
    

    delete

    "sd*
    

    paste

    "sp
    

    insert mode:

    <C-r>*
    

    Toggle casing vim

    Thu 15. May 2025 | 2025-05-15

    Normal mode

    g~iw # toggle
    
    guiw # lowercase
    
    gUiw # uppercase
    

    Visual mode

    u # lowercase
    
    U # uppercase
    

    tmux config

    Thu 08. May 2025 | 2025-05-08

    Active colors

    Window/tab bar

    In version 3.3 use the answer in comment provided here by @AntK.

    set-window-option -g window-status-current-style bg=red
    In version 2.9 You should change this options to something like:
    

    Active window title color

    setw -g window-status-current-style fg=black,bg=white
    

    https://unix.stackexchange.com/questions/210174/set-the-active-tmux-tab-color

    Panel

    https://stackoverflow.com/questions/4889724/how-can-you-tell-which-pane-in-tmux-is-focused

    Ascii tegn

    Mon 05. May 2025 | 2025-05-05

    โ”€ โ”‚ โ” โ”˜ โ”Œ โ”” โ”œ โ”ค โ”ฌ โ”ด โ”ผ 
    โ• โ•‘ โ•’ โ•“ โ•” โ•• โ•– โ•— โ•˜ โ•™ โ•š โ•› โ•œ โ• โ•ž โ•Ÿ โ•  โ•ก โ•ข โ•ฃ โ•ค โ•ฅ โ•ฆ โ•ง โ•จ โ•ฉ โ•ช โ•ซ โ•ฌ 
    

    Autohotkey & replacements

    Mon 28. April 2025 | 2025-04-28

    Windows

    Shift F1 to open http://localhost:5173/

    script.ahk

    +F1::Run "http://localhost:5173/"
    

    pn1 to print 29090816894 (macro)

    script.ahk

    :*:pn1::29090816894 
    

    keyboard shortcut to print characters

    backtick (`) and tilde (~)

    script.ahk

    !1::SendText "``"
    !2::Send "~ "
    

    Mac

    Shift F1 to open http://localhost:5173/

    Shortcuts app

    1. New shortcut
    2. Open URL
    3. Details > Run with: (type Shift F1)

    Shortcut app may be closed

    Shortcut app

    pn1 to print 29090816894

    https://altitudemarketing.com/blog/text-macros-macos/

    Settings app

    keyboard shortcut to print characters

    backtick (`) and tilde (~)

    .config/skhd/skhdrc

    lalt - 1: skhd -t "\`"
    lalt - 2: skhd -t "~"
    

    SKHD links

    MSYS2

    Mon 07. April 2025 | 2025-04-07

    msys2.org

    • Node: pacman -S mingw-w64-x86_64-nodejs: https://packages.msys2.org/packages/mingw-w64-x86_64-nodejs

    Use MINGW64 app?

    wezterm pros&cons

    Wed 02. April 2025 | 2025-04-02

    pros

    • enkel รฅ confige, forstรฅelige docs

    cons

    • kan ikke defaulte shell til bash?
    • ctrl c stopper prosess selv i "visual" markering mode. WSL gjorde ikke det
    • treg pรฅ windows drive... fordi den fortsatt buker wsl-ubuntu bash?