News for hackers. Stuff that matters.

phpdave11

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?
Re:A faster way to calculate the day-of-the-week on Thursday August 20, 2026 @08:59AM (#49374048)
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

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.
Re:NPM packages from Red Hat have been compromised on Monday June 01, 2026 @11:30AM (#48358172)
As long as you embed it with an SRI integrity hash, you're safe, even if the remote server is compromised.
Re:Notepad++ for Mac – Independent community port on Sunday April 26, 2026 @11:14PM (#47917346)
I’ve been using Notepad Next on Mac: https://github.com/dail8859/NotepadNext
"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?

Re:Your phone is an entire computer on Friday March 13, 2026 @10:48PM (#47372798)
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...
Re:Your phone is an entire computer on Friday March 13, 2026 @02:52PM (#47368143)
The original iPhone ran OS X: https://youtu.be/x7qPAY9JqE4?t=522
Re:MinIO is now in maintenance-mode on Wednesday December 03, 2025 @11:58AM (#46136870)
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>

Re:Show HN: Write Go code in JavaScript files on Monday October 27, 2025 @10:02AM (#45721139)
It compiles the Go code to WASM, so it can be used browser side.
Re:QuestPDF: Modern .NET library for PDF document generation on Wednesday January 18, 2023 @04:24PM (#34433277)
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
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.

Re:Internal Combustion Engine on Friday April 30, 2021 @03:10PM (#26997910)
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.
Re:Winamp Skins Collection on Wednesday December 02, 2020 @06:02PM (#25282962)
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

Re:Embedded PDF viewer in Firefox 81 supports filling forms on Tuesday September 22, 2020 @06:15PM (#24560611)
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

Re:Embedded PDF viewer in Firefox 81 supports filling forms on Tuesday September 22, 2020 @03:45PM (#24558951)
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

Re:Scrollbar Blindness on Thursday August 27, 2020 @09:46AM (#24293612)
I like how the title of the article has a hidden scroll bar (reading on iPhone).
Re:Catching bugs early with static analysis on Monday August 12, 2019 @10:33AM (#20675741)
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...

Re:Catching bugs early with static analysis on Monday August 12, 2019 @09:12AM (#20675058)
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.
Re:Oh shit, git (2016) on Tuesday May 14, 2019 @09:07AM (#19909066)
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.