Skip to content

Instantly share code, notes, and snippets.

View thrawn01's full-sized avatar
🎯
Focusing

Derrick J. Wippler thrawn01

🎯
Focusing
View GitHub Profile
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 14, 2024 15:40
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@zjeaton
zjeaton / __Magnific Image Modal for Hugo.md
Last active October 8, 2024 05:44
Magnific Image Modal Pop-up for Hugo

Magnific Image Pop-Up Modal for Hugo

A working demo of the pop-up can be found here.

I wanted a modal pop-up for images on my new Hugo site, and couldn't find one that worked with the styling that I do to the image path name. I'm new to Hugo, but I feel that the solution is simple and effective. The close button has been optimzed for accessibility as it is named close, but displays only × (×).

File Placement

import argparse
import math
import textwrap
from datetime import timedelta
DURATIONS = {"s": 1, "m": 60, "h": 3600, "d": 86400, "w": 604800}
ERROR_RATES = [
0.0001,
0.0005,
0.001,

Sorting

Everyone does it differently 😭 and most query string parsers don't support LHS or RHS parsing or building. Prefer RHS for clarity and simplicity of parsing. I don't like the - or + operators because It's easy to over look.

Options from different sources

  • ChatGPT /users?sort=email,asc
  • RHS Single Field /users?sort=email:ASC
  • RHS Multiple Fields /users?sort=email:asc,name:desc
  • RHS Multiple Fields Keyed /users?sort=email:asc&sort=name:desc
  • LHS /users?sort=[asc]email
  • LHS Multiple Fields /users?sort=[asc]email,[desc]name