Lin Mei
@linm
Member · Member since Oct 2013
Frontend performance, CSS layout, browser internals.
0 followers · 0 following
Badges and trust level are earned across the whole community.
- Topics created
- 3
- Posts created
- 6
- Likes given
- 23
- Likes received
- 31
- Days visited
- 0
- Solutions
- 4
Days visited count across the whole community, not just this forum.
Most active topics
- CSS grid: make the last row items stretch to fill the width
3 replies · 11 votes
- TypeScript: type an object whose keys come from a union
2 replies · 5 votes
- Is it possible to style the scrollbar in Firefox?
0 replies · 2 votes
Most liked posts
- CSS grid: make the last row items stretch to fill the width
I have a grid with grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)). When the last row has fewer items they keep their column width. I want them to
11 likes
- How to center a div horizontally and vertically?
.parent { display: grid; place-items: center; } or with flex: .parent { display: flex; align-items: center; justify-content: center; } The parent needs a height
6 likes
- React: useEffect runs twice in development
In development with Strict Mode, React mounts, unmounts and re-mounts every component once to surface effects that are missing a cleanup. It does not happen in
5 likes
- TypeScript: type an object whose keys come from a union
I have type Theme = 'light' | 'dark' and want an object that must contain a colour for every theme. How do I type it?
5 likes
- Regex to match a hex colour like #fff or #1a2b3c
/^#(?:[0-9a-f]{3}){1,2}$/i {1,2} allows exactly 3 or 6 hex digits. Add |[0-9a-f]{8} inside the group if you also want #rrggbbaa.
3 likes
Top categories
Top tags
- #css 2
- #css-grid 1
- #firefox 1
- #generics 1
- #layout 1
Recent badges
- Is it possible to style the scrollbar in Firefox?
Liked by Jonah Weiss
::-webkit-scrollbar does nothing in Firefox. Is there an alternative?
Likes received · 10/12/2026
- TypeScript: type an object whose keys come from a union
Liked by user8841203
I have type Theme = 'light' | 'dark' and want an object that must contain a colour for every theme. How do I type it?
Likes received · 10/12/2026
- CSS grid: make the last row items stretch to fill the width
Liked by Jonah Weiss
I have a grid with grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)). When the last row has fewer items they keep their column width. I want them to
Likes received · 10/12/2026
- Is it possible to style the scrollbar in Firefox?
Liked by user3307719
::-webkit-scrollbar does nothing in Firefox. Is there an alternative?
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes given · 10/12/2026
- Embedded C: volatile still needed for memory-mapped registers?
Still required: volatile stops the compiler from caching or eliding the accesses. Barriers order accesses but do not force them to happen. You often need both o
Likes given · 10/12/2026
- Floating point: why is 0.1 + 0.2 != 0.3?
No — 0.1 and 0.2 have no exact binary representation, so the sum is 0.30000000000000004. Compare with a tolerance: Math.abs(a - b) < Number.EPSILON and use inte
Likes given · 10/12/2026
- Floating point: why is 0.1 + 0.2 != 0.3?
0.1 + 0.2 === 0.3 is false in JavaScript. Is the language broken?
Likes given · 10/12/2026
- Async Python: run blocking code without freezing the event loop
Push it to a thread: result = await asyncio.to_thread(blocking_fn, arg) For CPU-heavy work use a process pool with loop.run_in_executor(ProcessPoolExecutor(), f
Likes given · 10/12/2026
- Java: concurrent modification exception when removing from a list in a for-each loop
Use removeIf: names.removeIf(String::isBlank); or an explicit Iterator and it.remove().
Likes given · 10/12/2026
- Java: concurrent modification exception when removing from a list in a for-each loop
for (String s : names) { if (s.isBlank()) names.remove(s); } throws ConcurrentModificationException. How should I remove while iterating?
Likes given · 10/12/2026
- SQL: get the latest row per group
An index on (customer_id, created_at DESC) makes both of these fast.
Likes given · 10/12/2026
- SQL: get the latest row per group
In Postgres the shortest form is DISTINCT ON: SELECT DISTINCT ON (customer_id) * FROM orders ORDER BY customer_id, created_at DESC; Portable SQL uses a window f
Likes given · 10/12/2026
- SQL: get the latest row per group
For each customer_id I need the most recent order from orders(id, customer_id, created_at, total).
Likes given · 10/12/2026
- React: useEffect runs twice in development
Liked by Ben Achterberg
In development with Strict Mode, React mounts, unmounts and re-mounts every component once to surface effects that are missing a cleanup. It does not happen in
Likes received · 10/12/2026
- React: useEffect runs twice in development
Liked by Priya Raghunathan
In development with Strict Mode, React mounts, unmounts and re-mounts every component once to surface effects that are missing a cleanup. It does not happen in
Likes received · 10/12/2026
- React: useEffect runs twice in development
Liked by Tomás Ferreira
In development with Strict Mode, React mounts, unmounts and re-mounts every component once to surface effects that are missing a cleanup. It does not happen in
Likes received · 10/12/2026
- React: useEffect runs twice in development
Liked by Amara Nwosu
In development with Strict Mode, React mounts, unmounts and re-mounts every component once to surface effects that are missing a cleanup. It does not happen in
Likes received · 10/12/2026
- React: useEffect runs twice in development
Liked by Jonah Weiss
In development with Strict Mode, React mounts, unmounts and re-mounts every component once to surface effects that are missing a cleanup. It does not happen in
Likes received · 10/12/2026