HNHacker News
TopNewBestAskShowJobs

alkh

214 karma · joined March 2, 2023

submissionscomments
alkh··on Show HN: Lowfat – pluggable CLI filter that saved 91.8% of my LLM tokens
Thanks for your effort! I also think having examples of raw output before vs after using lowfat would be useful as well
alkh··on Guide.world: A compendium of travel guides
For Seoul, I think this is an interesting observation:

  Seoul is not a pretty city, at least not by most Western standards of beauty.
  It is a sprawling, haphazard mix with little apparent cohesion beyond a shared culture.
Personally, I really liked it because it has a different vibe from a more "sterile" city like Tokyo.
alkh··on How to build a `Git diff` driver
I bet there might be something but you can probably create your own by using ImageMagick[1] and some manipulations. For ex. for images, I would create a temp file or use a process substitition + open on OSX or xdg-open on Linux. Here is a first post about

Or you can make it even easier(cause the output is only a text) and simply print out the difference in metadata directly. You might need some other tools like ImageMagick but at least no shenanigans with viewing binary data as part of your diff.

[1]https://stackoverflow.com/questions/5132749/diff-an-image-us...

alkh··on Shell Tricks That Make Life Easier (and Save Your Sanity)
This snippet for zsh still has some rough edges but works for the majority of cases. Automatically extends any global alias when space is pressed in zsh. For ex. I have `alias -G G='rg -s'`, so if I type `command | G` it will autoexpand it to `command | rg -s` and so on.

  globalias() {
    local raw word
    # raw last blank-separated token, exactly as typed
    raw=${LBUFFER##\* }
    # shell-parsed last word
    word=${${(z)LBUFFER}[-1]}
    # if user typed \alias, don't expand
    if [[ $raw == \\* ]]; then
        zle self-insert
        return
    fi
    if alias -- ${(q)word} &>/dev/null; then
        zle _expand_alias
        zle expand-word
    fi
    zle self-insert
}

zle -N globalias bindkey ' ' globalias

alkh··on Show HN: Mcp2cli – One CLI for every API, 96-99% fewer tokens than native MCP
Can someone please explain how one would tell LLM to use such a CLI over a natively supported MCP server? Do you need to add the info about CLI into persistent memory(ex. AGENTS.md) and run an mcp server manually? Or it is something else?
alkh··on Visual introduction to PyTorch
Thank you, this seems like a very good intro to newcomers! Would be cool if you could continue these series with a few more advanced lessons as well
alkh··on Oh My Zsh adds bloat
Valid points, I learned something new today. Thanks, you were right. If using -ic flags I am getting around 300 ms... Interesting how I never noticed, guess I don't open many terminal during the day
alkh··on My article on why AI is great (or terrible) or how to use it
Omg, this is so great, that you so much! Gonna set up a bunch of A320 warning sounds to scare me in case I am idle for too long :)
alkh··on Oh My Zsh adds bloat
That's where I actually did it, by coincidence
alkh··on Oh My Zsh adds bloat
Like many other people, I use oh-my-zsh for default setup and that's it. I literally use a single plugin for git and very actively autoload my custom functions to avoid startup delay. With my 384 line config and oh-my-zsh on, here are the results:

$ hyperfine -N "zsh -lc 'exit 0'" "zsh -c 'exit 0'"

Benchmark 1: zsh -lc 'exit 0'

  Time (mean ± σ):      54.5 ms ±   6.3 ms    [User: 10.2 ms, System: 14.3 ms]

  Range (min … max):    38.1 ms …  64.9 ms    78 runs
Benchmark 2: zsh -c 'exit 0'

  Time (mean ± σ):       6.5 ms ±   1.4 ms    [User: 0.8 ms, System: 1.3 ms]

  Range (min … max):     3.9 ms …  14.2 ms    424 runs
It's crazy how their startup time is 380 ms, and I suspect something else might be the reason, not just oh-my-zsh
alkh··on Assorted less(1) tips
True. To combat that you can define a variable LESS with default options in your config file. In my case, I have export LESS='-R --quit-if-one-screen -i' (interpret escape sequences, cat input instead of showing it in a pager if it fits on a screen, enable smart-case searching)
alkh··on MyTorch – Minimalist autograd in 450 lines of Python
Imho, we should let people experiment as much as they want. Having more examples is better than less. Still, thanks for the link for the course, this is a top-notch one
alkh··on Assorted less(1) tips
Don't forget that you can enable syntax highlighting/file rendering(like pdf, markdown) in less with lesspipe https://github.com/wofr06/lesspipe. It is exteremely useful and improves readability a lot. What's nice is that this functionality is typically disabled in pipes, so you can be sure that your script will behave as intended.
alkh··on Go away Python
Have to post this monstrocity that let's you either run a python script with uv or with python directly if uv is not installed(for some of my collegues)

#!/usr/bin/env bash

""":"

if command -v uv > /dev/null

then exec uv run --script "$0" "$@"

else

exec python3 "$0" "$@"

fi

":"""

alkh··on Ghostty is now non-profit
Thanks, looks cool but not available for OSX (:
alkh··on Ghostty is now non-profit
Yeah, exactly, like Ctrl+Alt+T opening Xterm in Ubuntu. If I am not mistaken, if you have a file explorer open it will automatically open terminal in that specific folder(i.e. kind of like `cd`ing there first)
alkh··on Ghostty is now non-profit
The only thing I am missing now from Ghostty is being able to open it in any open Finder folder with a keyboard shortcut(like standard Ubuntu terminal). Ghostty already provides Finder-specific GUI shortcut but you need to use a mouse. Otherwise, stellar work(especially the ease of configuring it) and congrats to everyone involved!
alkh··on Cognitive and mental health correlates of short-form video use
Just want to thank you for the comprehensive extension list, this is very useful!
alkh··on The Pragmatic Programmer: 20th Anniversary Edition (2023)
I’m really glad I got it after stumbling across the original at my university library. It’s really nice reading it from time to time and getting inspired to become a better developer
alkh··on State of Terminal Emulators in 2025: The Errant Champions
Lol, mb, but I don't believe that's the case for Alacritty. As for the Apple Terminal, it is not great
alkh··on State of Terminal Emulators in 2025: The Errant Champions
I have been pretty happy with Alacritty for a while but just tried Ghostty and am a little bit mind-blown. The fact that it has a built-in theme picker is insanely convenient for people working on multiple computers at the same time(so the same theme might not work everywhere).

Overall, it literally looks like a better Alacritty alternative. The creator(s) did a great job!

alkh··on Show HN: Toolbrew – Free little tools without signups or ads
As a heads up, you might soon need a JS runtime to make it work[1]. You might have to tweak even more (:

[1]https://github.com/yt-dlp/yt-dlp/issues/14404

alkh··on Asciinema CLI 3.0 rewritten in Rust, adds live streaming, upgrades file format
This is great, congrats for such a huge accomplishment!

My only wish is if asciinema natively supported saving into svg or gif. This would allow you to easily add it to markdown files without the need to install side apps to convert the output to those formats.

alkh··on Show HN: Term.everything – Run any GUI app in the terminal
This is so cool, thanks for sharing! Having this on a Mac would be great but I understand that this might be a huge undertaking :)
alkh··on Toronto’s network of pedestrian tunnels
There's an app called "toronto path"[1] for iphone, it's pretty good.

[1]https://apps.apple.com/us/app/toronto-path/id6739152194

alkh··on I Don't Have Spotify
If one is thinking about switching from Apple Music to Spotify, can someone recommend a website to automatically move the song collection? I think it was easier a while ago but then Apple cracked down on it, so I am not sure if there's an automated option now
alkh··on Code formatting comes to uv experimentally
I enjoy using uv a lot but am getting afraid that it is getting bloated for no reason. For ex., the number of niche flags that a lot of subcommands support is very high + some of them seemingly achieve the same result(uv run --no-project and uv run --active). I'd rather them working on improving existing tools and documentation than adding new (redundant) functionality
alkh··on Show HN: OWhisper – Ollama for realtime speech-to-text
Sorry, maybe I missed it but I didn't see this list on your website. I think it is a good idea to add this info there. Besides that, thank you for the effort and your work! I will definetely give it a try
alkh··on Dotfiles feel too personal to share
I thought about recreating the repo from scratch too. I was transfering from Intel to ARM Mac and keep a few tags/commits related to previous configs, so it is hard to just let it go :)
alkh··on Dotfiles feel too personal to share
That's something I was a little bit conflicted about for some time. After using a few open source tools(shoutout to syncthing and linkding :)) and I realised that if you want to use something for free, sharing is the least you can do.

My dotfiles are private for now cause I need to clean some commits(I think I might have added some private info before) but I intend to publish them eventually

Page 1 of 4Next →