About

yulia

Hi, I'm yulia. This is my personal blog — notes on technology, reading, and the occasional slice of life.

Cadence: Written whenever something is worth writing down.

Notes and thoughts.

yulia.com.cn
HomeAbout
Page 2 of 2
yulia 10219ee912421f0b ·
A gotcha with position: sticky

Lost an hour today to a layout issue: a sidebar's position: sticky refused to work.

Classic cause: if any ancestor has overflow: hidden (or auto, or scroll), sticky silently fails — it needs a scrollable context.

Debugging checklist

  1. The sticky element needs a top (or similar) threshold
  2. No non-visible overflow anywhere up the parent chain
  3. The parent must be tall enough — otherwise there's nothing to stick within

Written down so I trip over it once less.

yulia 10219ee912421f0b ·

I hesitated at the door; the rain was neither heavy nor light. Went anyway.

A rainy park is a different world: empty track, just a few people strolling under umbrellas. Five kilometres done, shoes soaked, but surprisingly good.

A few takeaways:

  • Light rain doesn't matter once you're moving
  • Shoes can get wet; they dry at home
  • The only real concern is your phone — use a waterproof pouch

No more hesitating on rainy days.

yulia 10219ee912421f0b ·
Beyond the basics of git stash

Many people (my past self included) only use git stash and git stash pop. It does much more.

Often-overlooked commands

git stash push -m "wip: login refactor" # a note for future you
git stash list                          # see what's shelved
git stash show -p stash@{1}             # inspect the diff
git stash apply stash@{2}               # apply without dropping
git stash drop stash@{0}                # delete one entry
git stash branch fix/login stash@{1}    # branch straight from a stash

The last one is a life-saver: if you've changed other things since stashing, branch from the stash instead of fighting conflicts.

yulia 10219ee912421f0b ·

After months of deliberation, I finally got a mechanical keyboard.

I went with linear switches — quiet enough for an office. Two weeks in:

  • Actuation force matters more than expected; too light means accidental presses
  • Keycap profile changes the feel a lot; OEM height suits me best
  • The sound is genuinely satisfying, and genuinely louder

Worth it? For someone who types thousands of words a day, yes.

yulia 10219ee912421f0b ·
Notes on HTTP caching

I look this up every time, so here's the note I keep needing.

Two kinds of caching

Kind Behavior Headers
Fresh no request at all Cache-Control: max-age=…, Expires
Conditional asks the server if it changed ETag / If-None-Match, Last-Modified / If-Modified-Since

In practice

  • Fingerprinted assets: max-age=31536000, immutable
  • HTML: no-cache (revalidate every time), or a very short max-age
  • Only no-store means truly no caching; no-cache means revalidate

Biggest misconception: no-cache does not mean "don't cache".

yulia 10219ee912421f0b ·

A status report on the three residents of my windowsill.

  • Mint: thriving — already harvested twice for lemon-mint water. It grows back faster after each cut.
  • Succulent: getting leggy, stem stretching out. Clear cause: not enough light. Moved to the sunniest spot; watching.
  • Pothos: zero drama. The water-cultured roots are impressive.

Lesson: plant problems are usually light or water. Don't reach for fertilizer first.

yulia 10219ee912421f0b ·
A memo on TypeScript narrowing

I use narrowing daily but still pause to pick the right tool.

Three common shapes

// 1. Primitives: typeof
function pad(x: string | number) {
  if (typeof x === "string") return x.padStart(8, "0");
  return String(x).padStart(8, "0");
}

// 2. Object shapes: in
function area(s: { r: number } | { w: number; h: number }) {
  if ("r" in s) return Math.PI * s.r ** 2;
  return s.w * s.h;
}

// 3. Best: discriminated unions
type Shape =
  | { kind: "circle"; r: number }
  | { kind: "rect"; w: number; h: number };

Pair a discriminated union with switch and a never fallback, and the compiler warns you when a new variant isn't handled — that's the real win.

yulia 10219ee912421f0b ·
A city walk with no destination

On Saturday I tried something very simple: go out, keep the map closed, and just walk.

What I found:

  • A small shop selling old cameras, where the owner tells you each one's history
  • A bakery lane that only opens in the afternoon — cinnamon rolls gone by four
  • A secondhand bookshop hidden inside a residential block, selling by the kilo

Most days, walking is just "from A to B", and the city collapses into metro stops and navigation lines. Unfold it once in a while and you realize how big it really is.

One afternoon a month, from now on.

yulia 10219ee912421f0b ·

This blog is fully static: Markdown becomes HTML at build time, and what's deployed is just files. People ask why there's no admin panel, no comments.

Reasons

  1. Nothing to maintain: no database, no backups to worry about; no server, no security patches
  2. Fast: files served as-is, no runtime at all
  3. Sustainable writing: the simpler the pipeline, the lower the mental cost of publishing

No comments for now — if you want to say something, write me a letter. Static isn't a limitation; it's a choice.

Page 2 of 2