HNHacker News
TopNewBestAskShowJobs

phpdave11

58 karma · joined May 14, 2019

submissionscomments
phpdave11··on Show HN: Videre – a Rust CLI to manage your photos and videos with joy
How does it handle Live Photos? I believe they are stored as 2 files. There are also metadata files created when you edit a photo. Does it handle these?
phpdave11··on A faster way to calculate the day of the week
For figuring the doomsday of a particular year, you can use the Odd+11 rule.

Let X be the last two digits of a year.

If X is odd, add 11.

Divide X by 2.

If X is odd, add 11.

Let Y = 7 − (X mod 7).

Count forward Y days from that century's anchor day to get the year's doomsday.

https://arxiv.org/pdf/1010.0765

phpdave11··on Accidentally deleted subscriptions for chat integrations (Slack and MS Teams)
https://www.dayswithoutgithubincident.com/
phpdave11··on The Pirate Bay Remains Resilient, 20 Years After the Raid
This is a good point. Another problem with streaming services, specifically for music streaming services, is that they can change the track of a previously released album with no user choice to hear the original. Example: Track 4 of Elephunk by the Black Eyed Peas. It was universally replaced with the “clean” version of the song. I’m not a fan of rewriting history.
phpdave11··on Malicious npm packages detected across Red Hat Cloud Services
As long as you embed it with an SRI integrity hash, you're safe, even if the remote server is compromised.
phpdave11··on Notepad++ for Mac – Independent community port
I’ve been using Notepad Next on Mac: https://github.com/dail8859/NotepadNext
phpdave11··on Artemis II astronauts arrive at launch pad 39B in an astrovan
"Before NASA sends astronauts to actually land on the Moon in 2028, they need to be absolutely certain that the Orion spacecraft, the Space Launch System rocket, and all the life-support systems work exactly as intended in the deep space environment where no quick rescue is possible."

They did it 53 years ago. Right? So what’s the problem?

phpdave11··on Your phone is an entire computer
This looked interesting but the workaround might have been patched by Apple in newer iOS versions: https://www.reddit.com/r/iphone/comments/1p3e2bf/my_hacked_i...
phpdave11··on Your Phone Is an Entire Computer
The original iPhone ran OS X: https://youtu.be/x7qPAY9JqE4?t=522
phpdave11··on MinIO is now in maintenance-mode
If you just need a simple local s3 server (e.g. for developing and testing), I recommend rclone.

rclone serve s3 path/to/buckets --addr :9000 --auth-key <key-id>,<secret>

phpdave11··on Show HN: Write Go code in JavaScript files
It compiles the Go code to WASM, so it can be used browser side.
phpdave11··on QuestPDF: Modern .NET library for PDF document generation
It shouldn't be too difficult to add support for this. I authored a Go library which adds support for importing PDFs into a new PDF generator (either gofpdf or gopdf). It is around 2,500 lines of code: https://github.com/phpdave11/gofpdi
phpdave11··on LibRedirect: Redirect YouTube, Twitter, Instagram to privacy friendly services
I am using an alternative which doesn't require any additional browser extensions, but it does require that each client installs a custom root certificate.

I have a split-DNS setup where I override the DNS entries for certain sites like reddit, twitter, and youtube so that they point to a local server. The local server returns privacy-friendly versions of those sites (e.g. spikecodes/libreddit).

I use the root certificate to sign SSL certificates for those domains which will be trusted by each client on the network as long as they've installed the custom root certificate.

That way, when I visit a reddit link from a google search, it automatically returns the privacy friendly version of the site, as long as the root certificate is installed.

This is especially nice using when using iDevices, because those don't support native browser extensions.

phpdave11··on Internal Combustion Engine
This was really educational! I love the design of the webpage, and I especially like how you can rotate the 3d diagrams and see each component from every angle.
phpdave11··on Winamp Skins Collection
I wish I could still compile XMMS from ports on FreeBSD. It seems to have been removed because glib12 is obsolete.

Thanks for letting me know about QMMP. Looks like it can be built from ports: https://www.freshports.org/multimedia/qmmp-qt5

phpdave11··on Embedded PDF viewer in Firefox 81 supports filling forms
Reading them is also easy. I wrote a library that reads PDFs and imports page(s) from an existing PDF into a new PDF as a Form XObject.

https://github.com/phpdave11/gofpdi

phpdave11··on Embedded PDF viewer in Firefox 81 supports filling forms
It's really not that difficult if you read and understand the PDF specification. As a learning exercise, I created a simple PDF generator library that creates ASCII PDF documents (you can open them in Notepad) and includes comments about what each drawing instruction does.

https://github.com/phpdave11/davepdf

phpdave11··on Scrollbar Blindness
I like how the title of the article has a hidden scroll bar (reading on iPhone).
phpdave11··on Catching bugs early with static analysis
Here's the bash script I use to do the code validation. It's called from within my Dockerfile.

https://gist.github.com/phpdave11/412893f8366cab0afa85e81a7a...

phpdave11··on Catching bugs early with static analysis
PHPStan is a great tool. In addition to PHPStan, I also use phpnsc (name space checker) to check for missing use statements, php-cs-fixer (code style fixer) to ensure the code adheres to my code style, phpcpd (copy paste detector) to detect duplicate code, and phpmd (mess detector) to find potential problems in the code. These are all set up in my CI pipeline so that my app will fail to build if any of these 5 tools detect a problem. It has saved me from deploying buggy code several times.
phpdave11··on Oh shit, git (2016)
You can use Mercurial with GitHub by using the hg-git plugin, which lets you push to and pull from a Git server repository from Mercurial.

It’s a really nice tool that I’ve been using for several years to push to git repositories.