Recent submissions

Comment · 5 months ago
Thanks for your effort! I also think having examples of raw output before vs after using lowfat would be useful as well
Comment · 6 months ago
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.
Comment · 6 months ago
Comment · 7 months ago
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

Comment · 7 months ago
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?
Comment · 8 months ago
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
Comment · 9 months ago
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
Comment · 9 months ago
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 :)
Comment · 9 months ago
That's where I actually did it, by coincidence
Comment · 9 months ago
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
Comment · 10 months ago
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)
Comment · 10 months ago
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
Comment · 10 months ago
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.
Comment · 10 months ago
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

":"""

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton