Skip to content

Instantly share code, notes, and snippets.

@mrgnw
mrgnw / _docker pull.md
Last active December 19, 2023 05:56
Docker pull multiple

Minimal docker-compose to pull a bunch of images. With a docker-compose.yaml like the one below, just run:

docker-compose pull
@mrgnw
mrgnw / _homebrew env.md
Last active December 20, 2023 06:47
homebrew env

Homebrew 4.2.0 added .env support (2023-12-18

  • system-wide: /etc/homebrew/brew.env
  • prefix-specific $HOMEBREW_PREFIX/etc/homebrew/brew.env
  • user-specific: ~/.homebrew/brew.env

I removed these exports from my dotfiles

@mrgnw
mrgnw / zhuli.zsh
Created September 14, 2023 09:01
Does the thing • "Zhu Li, do the thing!" • https://avatar.fandom.com/wiki/Zhu_Li_Moon
#!/usr/bin/env zsh
# Does the thing.
# "Zhu Li, do the thing!"
# https://avatar.fandom.com/wiki/Zhu_Li_Moon
# Make a .thing file to define what exactly that is.
if [[ -f .thing ]]; then ./.thing
elif [[ -f docker-compose.yml || -f docker-compose.yaml ]]; then docker-compose up
elif [[ -f main.py ]]; then uvicorn main:app --reload
@mrgnw
mrgnw / _potential implementation.md
Last active July 20, 2020 13:20
expandable details.md

<details> is underused IMO, especially in docs & readme's.

Could there be an easy, sensible markdown syntax that would increase usage?

How it is --> how it could be?

diff

Idea 1: Headers

Headers could be a natural way to set boundaries.

@mrgnw
mrgnw / userChrome.css
Last active February 6, 2019 04:36
Firefox userChrome CSS #config
/*
Use with Tree Style Tab Firefox extension - styles Firefox to remove tab bar
sources: https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules#auto-showhide-sidebar-by-mouseover-hover
https://gist.github.com/collinbarrett/45c90f7d427e08d69d32dfef402c86f6
macOS: ~/Library/Application Support/Firefox/Profiles/<Your Firefox Profile>/chrome
Linux: /home/<Your Username>/.mozilla/firefox/<Your Firefox Profile>/chrome/;
Windows: C:\Users\<Your Username>\AppData\Roaming\Mozilla\Firefox\Profiles\<Your Firefox Profile>\chrome
@mrgnw
mrgnw / lists and dicts.md
Created January 4, 2019 19:30
python #snippets

Get all values with a certain key from a list of dicts

set([x['key'] for x in list_of_dicts]

@mrgnw
mrgnw / chrome extensions.md
Created December 19, 2018 21:44
Chrome extensions #config
@mrgnw
mrgnw / README.md
Last active May 28, 2021 19:00
iTerm2 scripts #config #macOS

iTerm2 Scripts

Docs

iTerm loads .scpt AppleScript files from:

~/Library/Application Support/iTerm2/Scripts
@mrgnw
mrgnw / regex.md
Last active October 25, 2018 17:09
regex #snippets

Extract between quotes

"(.*?)"

… even if there are quotes within quotes

(["'])(?:(?=(\\?))\2.)*?\1