Skip to content

Instantly share code, notes, and snippets.

View ryuheechul's full-sized avatar
๐Ÿ’ป
hacking on projects!

Heechul Ryu ryuheechul

๐Ÿ’ป
hacking on projects!
View GitHub Profile
@ryuheechul
ryuheechul / svelte-custom-element-on-astro.md
Last active March 8, 2025 07:50
Svelte Custom Element on Astro
@ryuheechul
ryuheechul / tailwindcss-grace-manual-theme-override.md
Last active March 3, 2025 08:47
tailwindcss graceful manual theme override that repects `prefers-color-scheme: dark` when there is no input from a user.

Meta

During a development of one of my web project, I discovered the gap between DaisyUI and tailwindcss on how each handles the system's theme (via prefers-color-scheme: dark) and manual theme override (via something like [data-theme] in case to give users to override against the system theme). Although the proposed the solution from me (you can see by continouly reading this gist) is not very complex, this can be confusing for people who have no similar experience on handing these. Hence sharing it as gist.

The Problem

DaisyUI (v5) and tailwindcss (v4) both work (automatically) well with prefers-color-scheme: dark (aka following OS theme).

And DaisyUI allow you to override the theme with [data-theme], which tailwindcss does not work with it unless you manually override the config as describe as https://tailwindcss.com/docs/dark-mode#using-a-data-attribute.

@ryuheechul
ryuheechul / _zerotier-dns-client-conf-with-resolved.md
Last active December 6, 2024 16:55
Zerotier DNS Client Setup on Linux (with systemd-resolved)

This is about the script originally written for https://github.com/ryuheechul/dotfiles/commit/1c5795d4e69ad7ad8c191e3e96fe43155522739a#diff-4f848b5499b37dbeb494a252ab49d56831abb5b12dbd362ab5182f509f7ad97b

This Script Will

the script is pretty short and relatively simple, so I recommend you to read it but the gist is below

  1. get necessary details regarding (your already configured) zerotier network interface and running DNS server
  2. configure DNS routing via resolvectl for systemd-resolved with the parse information from the previous step
  3. (now resolving to FQDN (e.g. host device.home.arpa) should work as well as search domain (e.g. host device)
  4. (unfortunately the change doesn't last after a reboot - so I'm looking into a way to resolve this)
@ryuheechul
ryuheechul / summary-of-monitoring-distributed-systems-in-korean.md
Last active May 22, 2024 03:24
[์š”์•ฝ] ๋ถ„์‚ฐ ์‹œ์Šคํ…œ ๋ชจ๋‹ˆํ„ฐ๋ง (๊ตฌ๊ธ€์˜ SRE ์ฑ…์˜ ์ผ๋ถ€)

๋ถ„์‚ฐ ์‹œ์Šคํ…œ ๋ชจ๋‹ˆํ„ฐ๋ง

https://sre.google/sre-book/monitoring-distributed-systems/ ์„ ๊ฐ„๋‹จํžˆ ์˜์—ญ ๋ฐ ์š”์•ฝ

๋ชจ๋‹ˆํ„ฐ๋ง์„ ์™œ ํ•˜๋Š”๊ฐ€ Why Monitor?

  • ๋กฑํ…€ ํŠธ๋ Œ๋“œ ๋ถ„์„ Analyzing long-term trends
  • ์‹œ๊ฐ„ ๋˜๋Š” ์‹คํ—˜ ๊ทธ๋ฃน๋“ฑ์„ ๋น„๊ต Comparing over time or experiment groups
  • Alerting
  • Building dashboards
  • ํŠน๋ณ„์ผ€์ด์Šค์˜ ํšŒ๊ณ  ๋ถ„์„ (์˜ˆ: ๋””๋ฒ„๊น…) Conducting ad hoc retrospective analysis (i.e., debugging)
@ryuheechul
ryuheechul / openwrt-efi-on-proxmox.md
Last active March 30, 2025 14:17
How to "Install" an OpenWRT VM in Proxmox with UEFI

Existing references I looked at before I went on trial and error until eventually I managed to make it work:

Note

Although links above were good references to look at so I didn't have to start from scratch, following none of them actually worked for me. Hence, I'm leaving my own note after figuring things out.

My situation:

@ryuheechul
ryuheechul / python_literal_type_checking.py
Last active March 27, 2024 21:38
ensure literal type from a dynamic value by employing "guard" function in python
"""
seems like hard coding is the only way to make literal type to accept anything to be literal
(which makes sense if you think about it)
"""
from typing import Any, Literal
my_literal_type = Literal["a", "b", "c"]

I actually didn't really know about the difference between $@ and "$@" until now.

I always had assumed that "$@" is not desirable thinking this would deliver argsments as just one.

Turns out that's not true and you can read about it from man bash.

@     Expands  to  the  positional  parameters,  starting from one.  In contexts where
       word splitting is performed, this expands each positional parameter to a separa
      te word; if not within double  quotes, these words  are  subject to word splitti
@ryuheechul
ryuheechul / python-dev-on-nixos.md
Last active December 7, 2024 19:32
Python dev on NixOS

Does it look familiar?

Welcome to an error like this below.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/user/python-proj/main.py", line 2, in <module>
 import grpc
@ryuheechul
ryuheechul / 0-meta.md
Last active December 20, 2024 14:49
NixOS on Microsoft Surface Pro 8

NixOS on Microsoft Surface Pro 8

What Is This Note About

This is mostly a short version of information dump and sharing my experience regarding installing (and using) NixOS on Microsoft Surface Pro 8 device.

TL;DR: