Trending
Tomáš Hubelbauer's Avatar

Tomáš Hubelbauer

@hubelbauer.net

Full snack developer by day. Sleeper by night.

73
Followers
3
Following
76
Posts
09.04.2023
Joined
Posts Following

Latest posts by Tomáš Hubelbauer @hubelbauer.net

TIL, thank you!

11.11.2024 12:21 👍 1 🔁 0 💬 0 📌 0

Just rawdogging this walk (I forgot to charge my earbuds)

10.11.2024 09:07 👍 1 🔁 0 💬 0 📌 0
{
  "compilerOptions": {
    "module": "ESNext",
    "moduleDetection": "force",
    "target": "ESNext"
  }
}

{ "compilerOptions": { "module": "ESNext", "moduleDetection": "force", "target": "ESNext" } }

To get VS Code's TypeScript language server to stop complaining about TLA when your runtime supports it (e.g.: Bun) without having to add `export {}`, use this TSConfig:

28.02.2024 19:53 👍 0 🔁 0 💬 0 📌 0

Super eerie and picturesque blue hour outside right now. Tonight was not the night to forget my camera for my way home. 😭

12.02.2024 17:08 👍 0 🔁 0 💬 0 📌 0

GitHub Copilot is down. Got the same feeling when waiting for it to complete a repetitive line now that you get when pressing the touch pad on the MBP when it is off. It doesn't physically click, it has electronic haptic feedback. It's kind of like missing a step on the stairs.

12.02.2024 09:56 👍 0 🔁 0 💬 0 📌 0

I saw references to a recent study showing that vertically mounted bifacial solar panels end up making up for the power loss due to the bad angle with increased efficiently thanks to improved thermals. I think I'll give reproducing this a shot, seems practical for dual land use.

09.02.2024 16:06 👍 0 🔁 0 💬 0 📌 0
A screenshot of VS Code displaying the rename UI in a MarkDown link URL.

A screenshot of VS Code displaying the rename UI in a MarkDown link URL.

TIL: in VS Code, you can F2 to rename files (and images) referenced in MarkDown links. It renames the link URL as well as the file name on disk. Very useful with the ability to paste an image into a MarkDown document from the clipboard to set the file name right after the paste.

08.02.2024 15:45 👍 0 🔁 0 💬 0 📌 0

Tapping into my luck and patience reserves for the next month trying to get a doctor to see me for 15 minutes with hopefully less than a four hour wait. Right now chilling in the waiting room before the actual waiting room.

31.01.2024 12:01 👍 0 🔁 0 💬 0 📌 0

For an Android which won't show up in Finder even when the USB mode is set to File Transfer, it looks like the only other GUI option is to use Android Studio, start a blank project (???) and only then be able to use Device Manager? There is no way to open it standalone directly?

19.01.2024 12:54 👍 0 🔁 0 💬 0 📌 0
git branch
# * main
#   ticket-000-feature-branch

git branch "*000*"
# fatal: '*000*' is not a valid branch name

git branch -l "*000*"
#   ticket-000-feature-branch

git switch "*000*"
# fatal: invalid reference: *000*

git branch -l "*000*" | xargs git switch
# ✅

git branch # * main # ticket-000-feature-branch git branch "*000*" # fatal: '*000*' is not a valid branch name git branch -l "*000*" # ticket-000-feature-branch git switch "*000*" # fatal: invalid reference: *000* git branch -l "*000*" | xargs git switch # ✅

I wish the Git CLI allowed one to use a branch name pattern in `switch`. The `branch` command let's one use patterns without `grep` with the `-l "*pattern*"` option, but `switch` doesn't, so unergonomic concoctions with `xargs` have to be conjured.

19.01.2024 11:09 👍 0 🔁 0 💬 0 📌 0

And another TIL because I always forget this: To apply a style to a child selector in Tailwind and mark is as `!important` at the same time:

`[&_canvas]:!w-full`

This is _not_ elegant, but it can be used to make certain non-headless libraries behave. Here I'm scolding PDFjs.

15.01.2024 13:15 👍 0 🔁 0 💬 0 📌 0
The Figma context menu showing the Copy as PNG option.

The Figma context menu showing the Copy as PNG option.

TIL: To enable Copy as PNG in Figma on Firefox, enable `dom\.events.asyncClipboard.clipboardItem` (without the slash) in `about:config`. This let's JavaScript `write` other stuff to your clipboard than just text: caniuse.com/mdn-api_clip...

15.01.2024 12:40 👍 1 🔁 0 💬 0 📌 0
// Firefox: 700 B or ~1 minute
// Chrome: 0 B
// Safari: ∞ B or ~1 minute
Bun.serve({
  async fetch(request) {
    return new Response(
      new ReadableStream({
        type: "direct",
        async pull(controller) {
          //await controller.write(' '.repeat(…));
          await controller.flush();
          while (!request.signal.aborted) {
            await controller.write(
              `${new Date().toLocaleTimeString()}<br />`
            );
            
            await controller.flush();
            await Bun.sleep(1000);
          }

          controller.close();
        },
      }),
      { status: 200, headers: { "Content-Type": "text/html" } },
    );
  }
});

// Firefox: 700 B or ~1 minute // Chrome: 0 B // Safari: ∞ B or ~1 minute Bun.serve({ async fetch(request) { return new Response( new ReadableStream({ type: "direct", async pull(controller) { //await controller.write(' '.repeat(…)); await controller.flush(); while (!request.signal.aborted) { await controller.write( `${new Date().toLocaleTimeString()}<br />` ); await controller.flush(); await Bun.sleep(1000); } controller.close(); }, }), { status: 200, headers: { "Content-Type": "text/html" } }, ); } });

I've revisited the world of streamed HTML documents after a few years and it looks like as of today, this is how long browsers take to start rendering the partial HTML document while it is still streaming :
- Firefox: 700 B or ~1 minute
- Chrome: 0 B
- Safari: ∞ B or ~1 minute

05.01.2024 16:31 👍 0 🔁 0 💬 0 📌 0
# Run a command in the current directory
echo "Hi from main directory"

# Run a command in a different directory
# Note that the `cd` walk affects onlt the
# subshell (the parenthesised expression)
(cd ../../directory && echo "Hi from elsewhere")

# Note that the above being a one-liner, it is
# recallable and repeatable using the up arrow
# in a single shot!

# Continue in the unchanged directory with no
# need to use `cd` to walk back
echo "Still in the main directory here"

# Run a command in the current directory echo "Hi from main directory" # Run a command in a different directory # Note that the `cd` walk affects onlt the # subshell (the parenthesised expression) (cd ../../directory && echo "Hi from elsewhere") # Note that the above being a one-liner, it is # recallable and repeatable using the up arrow # in a single shot! # Continue in the unchanged directory with no # need to use `cd` to walk back echo "Still in the main directory here"

This is gonna be painfully obvious to anyone with all but the most surface level knowledge of shells, but as a shell non-enjoyer, I was happy to learn how to run a command in a different directory on a single line with no need to walk back (and thus up-arrow + Enter repeatable):

05.01.2024 15:09 👍 0 🔁 0 💬 0 📌 0

TIL how to identify misbehaving Firefox extensions by their ID if they spam the Console dev tools tab. Copy the UUID in the URL (the messages don't show the ext name), go to about:debugging > This Firefox (or just about:debugging#/runtime/this-firefox) and search for the UUID.

02.01.2024 18:00 👍 0 🔁 0 💬 0 📌 0

Thanks for the hint! I think I know what you mean. Sounds like a better way to attack the problem, will give it a shot.

07.12.2023 10:11 👍 0 🔁 0 💬 0 📌 0

Advent of Code 2023 day 5 part 2 is beating my ass. My naive solution doesn't finish and I'm not sure if my idea on how to optimize it is sound, so I will need to learn to profile Elixir code to see what takes what amount of time and where I can avoid extra work.

06.12.2023 12:06 👍 0 🔁 0 💬 1 📌 0
IO.inspect(["33"] |> Enum.map(&String.to_integer/1))
# ~c"!"

IO.inspect(Enum.map(["33"], &String.to_integer/1))
# ~c"!"

x = fn string -> String.to_integer(string) end
IO.inspect(Enum.map(["33"], fn s -> x.(s) end))
# ~c"!"

IO.inspect(String.to_integer("33"))
# 33

IO.inspect(["33"] |> Enum.map(&String.to_integer/1)) # ~c"!" IO.inspect(Enum.map(["33"], &String.to_integer/1)) # ~c"!" x = fn string -> String.to_integer(string) end IO.inspect(Enum.map(["33"], fn s -> x.(s) end)) # ~c"!" IO.inspect(String.to_integer("33")) # 33

Came across this incredibly strange behavior where #Elixir's String.to_integer/1 would seemingly convert a string to a char instead of a number for some numbers. Turns out it is an Erlang hold-over in the behavior of IO.inspect formatting! stackoverflow.com/a/30039460/2...

04.12.2023 21:28 👍 1 🔁 0 💬 0 📌 0
Preview
Termosublimační tiskárna Polaroid HI-PRINT Pocket Printer Pokud sháníte kvalitní kapesní tiskárnu, mohla by vám přijít vhod termosublimační tiskárna&nbsp;Polaroid HI-PRINT Pocket Printer. Vytiskne vaše fotografie z chytrého telefonu na vysoce kv...

Mam Polaroid Hi-Print: www.alza.cz/polaroid-hi-...

Jsem s ni spokojeny. Je to skvela vec na to rozdat fyzicke fotky jako vzpominku lidem na oslavach a spolecenskych akcich. Mivam z toho lepsi pocit, nez si vzajemne poslat sto fotek pres AirDrop. Jen me mrzi, ze tahle nema bily ramecek plne okolo.

04.12.2023 12:31 👍 2 🔁 1 💬 1 📌 0

Day two of Advent of Code 2023 with Elixir done! I am focusing on learning the language and not optimizing the solutions and so far I am liking Elixir a lot. The VS Code language server extension is excellent, too. Happy with my choice of language so far.

04.12.2023 12:26 👍 1 🔁 0 💬 0 📌 0

In a slightly belated manner, I have decided to participate in the Advent of Code 2023 and try to solve the puzzles in Elixir. Just solved day 1 and it's already proving very education seeing as I've never used Elixir before!

03.12.2023 23:46 👍 0 🔁 0 💬 0 📌 0
A screenshot of a cube made with aesthetic_cube with all features turned on, making it appear as a regular cube and only made apparent by the semi-transparent mesh color reveling the inner structure comprising of 3D cubes for all cube features - faces, edges and corners.

A screenshot of a cube made with aesthetic_cube with all features turned on, making it appear as a regular cube and only made apparent by the semi-transparent mesh color reveling the inner structure comprising of 3D cubes for all cube features - faces, edges and corners.

Another rendering of a cube made with aesthetic_cube, this time with only faces enabled and edges and corners hidden, resulting in a shape which when stacked flush together in lines and levels doesn't blend together to a single face, but preserves the appearance of a surface made from individual building blocks due to the shading of the geometry of the individual cubes.

Another rendering of a cube made with aesthetic_cube, this time with only faces enabled and edges and corners hidden, resulting in a shape which when stacked flush together in lines and levels doesn't blend together to a single face, but preserves the appearance of a surface made from individual building blocks due to the shading of the geometry of the individual cubes.

I've released an #OpenSCAD module for drawing cubes with their faces, edges and corners optionally made invisible. Useful to visualize seams between blocks sat flush one next to another when approximating more "organic" cube parts with imperfect edges. github.com/TomasHubelba...

02.12.2023 23:08 👍 0 🔁 0 💬 0 📌 0
Preview
Consider implementing a digit separator symbol for better skimmability of large numbers · Issue #48... Is your feature request related to a problem? Please describe. I am sticking to a single unit (in this case, mm) when working on my model because it comprises of parts whose spec sheets give the di...

Just proposed the introduction of numeric separators to the #OpenSCAD language. I really like this feature in JavaScript and C# and I've been missing it in OpenSCAD greatly. Crossing my fingers for the OpenSCAD maintainers to be open to the proposal. github.com/openscad/ope...

02.12.2023 20:44 👍 0 🔁 0 💬 0 📌 0

I really seem to have a soft spot for spoken word music. I've been obsessed with Listener for a long time now, but recently, I've discovered Forest Knot, and his collabs with Crocodile Scissor Cut have me feeling all kinds of content. 😌

01.12.2023 16:18 👍 0 🔁 0 💬 0 📌 0
A screenshot of the Washington Post daily crossword puzzle app showing a clue that says "Really, really into crosswords, say" with the answer being "nerdy"

A screenshot of the Washington Post daily crossword puzzle app showing a clue that says "Really, really into crosswords, say" with the answer being "nerdy"

The Washington Post daily crossword puzzle has no chill today.

28.11.2023 15:56 👍 0 🔁 0 💬 0 📌 0

I've been watching way too many "Building a cabin/tiny house" YouTube videos recently and I'm starting to think the only way to break out of the loop will be to build one and get it out of my system. Of course I picked the wrong season to have this idea. Might start with a model.

28.11.2023 13:43 👍 0 🔁 0 💬 0 📌 0
A screenshot of the Flipper Zero display showing the Settings > Power > Battery Info screen with current consumption, battery SOC, temperature, voltage and health information.

A screenshot of the Flipper Zero display showing the Settings > Power > Battery Info screen with current consumption, battery SOC, temperature, voltage and health information.

I wish all battery-powered devices with a screen had this type of a feature where you can tell the current consumption and battery metrics at a glance.

23.11.2023 14:52 👍 0 🔁 0 💬 0 📌 0

I am dreaming of a declarative database schema with migrations based on a file where migrations are its historical versions in source control. Pros: proper migration diffs, just one file with the latest schema, so nice. There might be cons with this design I'm missing though.

30.10.2023 11:41 👍 0 🔁 0 💬 0 📌 0
A screenshot of the macOS menu bar Wi-Fi icon dropdown showing the wireless network names alongside a section beneath the connected one detailing the stuff like IP address, BSSID, RSSI and noise among others.

A screenshot of the macOS menu bar Wi-Fi icon dropdown showing the wireless network names alongside a section beneath the connected one detailing the stuff like IP address, BSSID, RSSI and noise among others.

TIL: Option-clicking the Wi-Fi icon in the macOS menu bar shows diagnostics information about the network interface and the connected wireless network. Extremely useful for fine-tuning directional antenna placement for best signal strength and noise levels.

29.10.2023 22:12 👍 0 🔁 0 💬 0 📌 0
Robot lawn mower cutting the grass at the edge of a park all the while doubling as an entertainer always keeping me on my toes as to where it is going to turn next.

Robot lawn mower cutting the grass at the edge of a park all the while doubling as an entertainer always keeping me on my toes as to where it is going to turn next.

My train got delayed and I missed the connecting bus, so now I'm forced to touch grass for two hours. But at least it's beautiful fall weather outside, the city I'm at has a nice park and the robotic lawn mower they have cutting the grass here provides sufficient entertainment.

28.10.2023 12:51 👍 0 🔁 0 💬 0 📌 0