HNHacker News
TopNewBestAskShowJobs

npretto

136 karma · joined September 7, 2020

submissionscomments
npretto··on Show HN: Port Kill – A lightweight macOS status bar development port monitor
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

npretto··on A 10-Year Battery for AirTag
Surely going to lunch with 10k of equipment is safer, especially when you'll need to go to the toilet.
npretto··on TS to JSDoc Conversion
this has nothing to do with "TS support" at all.
npretto··on Google stopping coding competitions
is this a sign that finding developers is not that hard anymore, and they don't need to organize these competitions with the hiring budget?
npretto··on The future (and the past) of the web is server side rendering
It does indeed render and index them: https://developers.google.com/search/docs/crawling-indexing/...
npretto··on An M1 for Curl
It could be that the donation comes from matching the donations of some employees, or similar programs.
npretto··on Cooking internet and lifting internet have the same problem
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

npretto··on Ask HN: Is having a personal blog/brand worth it for you?
I can confirm that your posts, tweets and replies in reddit/hn are helpful to people like myself
npretto··on Ask HN: What stack for a multiplayer board game?
You mentioned electron so I suspect you're interested in games playable via browser, in that case these two come to my mind in the javascript/typescript ecosystem:

- https://boardgame.io/

- https://www.colyseus.io/

npretto··on I replaced my native iOS app with a cross platform web app and no-one noticed
React native and flutter are very, very different from a PWA.

While a PWA is a web app, react-native renders actual native components, and flutter has its own rendering engine. I wouldn't call them "web-based" tech

npretto··on GitHub Actions Has Overbilling Bug
Came to hackernews to check if somebody else had this problem after I saw my usage was $24,522,457.08 and I barely use github actions
npretto··on I’m porting the TypeScript type checker tsc to Go
So this is a "This week vercel is sponsoring" episode...
npretto··on The Windows 11 taskbar is an annoying step backward
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)

npretto··on A tour to my Zettelkasten note clusters
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

npretto··on Gameboy CT scan – design lessons learned
try increasing font size with [cmd]+[+] instead of using pinch-to-zoom, it works perfectly for me with that
npretto··on Show HN: BFS, Dijkstra and A* interactive demo made in React
Thanks for pointing that out, the link is actually kinda hidden. I added it to the readme
npretto··on Show HN: BFS, Dijkstra and A* interactive demo made in React
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.