Better HN
topnewbestaskshowjobs
Log inSign up

npretto

136 karma · joined Sep 7, 2020 (6y ago) · 22 submissions

Submissions

comment 1y ago · link · parent

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

comment 1y ago · link · parent

Surely going to lunch with 10k of equipment is safer, especially when you'll need to go to the toilet.

comment 3y ago · link · parent

this has nothing to do with "TS support" at all.

comment 3y ago · link · parent

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?

comment 3y ago · link · parent

It does indeed render and index them: https://developers.google.com/search/docs/crawling-indexing/...

comment 3y ago · link · parent

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

7.

Mobile apps ask for the photo library permission when they don't need it(npretto.com ↗)

2 points · by npretto · 4y ago · discuss

8.

Be good-argument-driven, not data-driven(twitchard.github.io ↗)

3 points · by npretto · 4y ago · discuss

comment 4y ago · link · parent

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

10.

Cooking internet and lifting internet have the same problem(youtube.com ↗)

2 points · by npretto · 4y ago · 1 comment

comment 4y ago · link · parent

I can confirm that your posts, tweets and replies in reddit/hn are helpful to people like myself

comment 4y ago · link · parent

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/

comment 4y ago · link · parent

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

comment 4y ago · link · parent

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

comment 4y ago · link · parent

So this is a "This week vercel is sponsoring" episode...

comment 4y ago · link · parent

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)

comment 4y ago · link · parent

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

comment 4y ago · link · parent

try increasing font size with [cmd]+[+] instead of using pinch-to-zoom, it works perfectly for me with that

19.

Godot Engine receiving a new grant from Meta's Reality Labs(godotengine.org ↗)

78 points · by npretto · 4y ago · 5 comments

comment 5y ago · link · parent

Thanks for pointing that out, the link is actually kinda hidden. I added it to the readme

comment 5y ago · link · parent

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.

22.

Show HN: BFS, Dijkstra and A* interactive demo made in React(github.com ↗)

94 points · by npretto · 5y ago · 22 comments