HN user

npretto

136 karma
Posts5
Comments17
View on HN

a couple of prompts of claude code gave me this, works well enough, but while I agree that this is sometimes useful, it may indeed better served by a couple of aliases in the terminal ``` #!/bin/bash

# SwiftBar Port Monitor # Monitors processes on TCP ports 2000-6000

# Menu bar title echo " Ports" echo "---"

# Get processes listening on TCP ports 2000-6000 processes=$(lsof -iTCP:2000-6000 -sTCP:LISTEN -n -P 2>/dev/null | awk 'NR>1 {print $2 "|" $1 "|" $9}' | sort -t'|' -k3 -n)

if [ -z "$processes" ]; then echo "No processes found on ports 2000-6000" exit 0 fi

# Process each line while IFS='|' read -r pid name port_info; do if [ -n "$pid" ] && [ -n "$name" ] && [ -n "$port_info" ]; then # Extract port number from format like :3000 port=$(echo "$port_info" | sed 's/.://')

        # Menu item with port and process name
        echo "[$port] $name | color=blue"
        
        # Submenu items
        echo "--Kill (TERM) | shell=kill param1=$pid terminal=false refresh=true"
        echo "--Kill Force (KILL) | shell=kill param1=-9 param2=$pid terminal=false refresh=true"
        echo "--Process Info | shell=ps param1=-p param2=$pid param3=-o param4=pid,ppid,user,command terminal=true"
        echo "-----"
    fi
done <<< "$processes"

# Refresh option echo "---" echo "Refresh | refresh=true

An M1 for Curl 4 years ago

It could be that the donation comes from matching the donations of some employees, or similar programs.

I think he published this video when I was starting to think about the same things, especially about working out, where it's more important to workout consistently with a decent form/weight than to spend hours reading up science and working out very little.

Most "benchmarks" or data that we have mean very little because of the context (or lack of) they are done.

I often read critics to benchmarks in here and how they are not "real life scenarios", seems like CS is not the only world where this happens

Yep, that's because of Fitts’ Law: the time we need to click a button is a function of the distance between the pointer and the button, divided by the area of the button.

When the button is in a corner the size is virtually infinite (we can move the mouse all we want in one direction and we'd still be over the button)

There's also obsidian-export[1] that converts the few things that are not plain markdown (`[[links]` and `![[links]]`).

To be honest, obsidian not being open source doesn't bother me too much, what is important to me is that I own the data and that it is in a fairly common format so i can move it to another software in 10 years. An open source software with a weird binary format to save the data will probably do more harm in the long term

[1] https://crates.io/crates/obsidian-export

Two years ago I had to make a project about pathfinding for a university project, and I just realised I never showed it anywhere.

I made this little interactive playground for various pathfinding algorithms showing how they can be seen as a general algorithm with different a different queue and different heuristic in use.

The readme has some theory but the cool thing is the link to the app on netlify where you can experiment moving the positions of start, goal and of the obstacles.

If you're interested I'd suggest you keep the readme open while toying with the app, as the readme has more theory.