Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
23 🇩🇰 Studying for a degree in Software Engineering while building fun projects and working freelance as a News Photographer 📷 I share my software projects, photos and videos from my work as a news photographer, and progress updates as I learn to sew garments. Basically, I just write about my hobbies. frederikhandberg.com
Frederik Handberg's avatar
frederikhandberg 10 months ago
Today, I’ve been making some fake profiles for my social media portfolio project and generating some content for their profiles (posts, comments, etc.) Tomorrow, I will be taking screenshots of the platform and writing about the platform for my personal website. Basically, I want to write about the features of the platform, struggles I had developing the platform along the way, future improvements that could be made, and so on. It should be a personal website I include a link to in my CV. #portfolio #internship
Frederik Handberg's avatar
frederikhandberg 10 months ago
Can't wait until summer... Been cloudy and gray all day, but finally the sky is clearing a bit. image
Frederik Handberg's avatar
frederikhandberg 10 months ago
This afternoon I’ve been working on implementing the notification system in my portfolio project. I settled on using Socket.IO running in an Express server. I had to do some restructuring as I did not want to implement a custom server running Socket.IO directly inside of NextJS. Because then I lose Turbopack (I think if I understood the docs correctly). So I made two directories in the project: - `client/` for the NextJS project - `server/` for the Express and Socket.IO It’s up and running. One of the notifications is when a user publishes a new post. That’s the only one working currently, but the plan is to implement more notification types. It takes a little while before the notification is received. Not sure why. I did a project in last semester of my SE degree where we used SignalR connected to Blazor, and the notifications were received instantly. I want this NextJS and Socket.IO project to be the same. I’ll have to tinker with it tomorrow. Also need to make the notification UI nicer. #dev #NextJS #SocketIO #NodeJS #portfolio
Frederik Handberg's avatar
frederikhandberg 10 months ago
Today I found out about mini cop cars! They are so adorable. Basically, they are miniature model cars that are identical to the real-world police vehicles. I just bought myself two Ford Explorer Police Interceptor Units in white and black respectively. Haven’t purchased lights for it yet, still need to do some research on that. Pretty cool that there is a whole community of people building these. Think it’d be a fun project and hobby to learn building these diecast models. #hobby
Frederik Handberg's avatar
frederikhandberg 10 months ago
Primal and Damus should allow sending delete requests to relays. It’s annoying having to go to some other client to delete notes.
Frederik Handberg's avatar
frederikhandberg 10 months ago
Yesterday, I made some progress on my portfolio project. Now, the change password option in settings is working. I made a dialog where the user will type their current password, the new password they want (must meet some requirements), and confirm the new password. I implemented two new API routes: - `/api/account/verify-password` - `/api/account/update-password` I also implemented two React Query hooks: 1. `useVerifyPassword.ts` 2. `useUpdatePassword.ts` I still need to implement a way to reset the password when logging in. I will of course just reuse the API routes and hooks that I just made, but they will need to be adapted a bit, since the user must identify themselves by username or email. In the real world, the user would need to type their email to reset their password. Then they would receive a one-time password, with a four digit code or a magic link. But since this is just a portfolio project, it seems like too much to set all that up. So, I’m just going to require the user to type their username or email, and if that user exists in the database, they will be allowed to enter a new password. #dev #portfolio #NextJS
Frederik Handberg's avatar
frederikhandberg 10 months ago
Using Next Auth for my portfolio project was a mistake. My authentication system uses email/username and password. The problem is that Next Auth strongly discourages developers from using credentials and instead pushes them to use OAuth. I should have used Better Auth instead… #dev #BetterAuth #NextAuth #NextJS
Frederik Handberg's avatar
frederikhandberg 10 months ago
# Quoting a Post For my social media network portfolio project, I am taking a different approach to quoting posts. Originally, I had a `/quote-post` page separate from the `/create-post` page. However, this didn’t make much sense because quoting a post is essentially creating a post. So, I have removed the `/quote-post` page and integrated all quoting functionality into the `/create-post` page. One feature I want to add is allowing users to quote multiple posts within the same post they are creating. Quoting a post is simple, just paste the link to the post, exactly like on Twitter/X. However, if a user pastes a link to the same post multiple times, it should only count as a single quote.
Frederik Handberg's avatar
frederikhandberg 10 months ago
I love markdown format 🖤 By far the best universal standard for text files. It’s perfect for writing notes — also great for math using LaTeX. At first, LaTeX looks super weird, but once you get the hang of it, it’s actually a really efficient way to write math equations. #latex #obsidian
Frederik Handberg's avatar
frederikhandberg 11 months ago
Apartment fire on Lichtenbergsgade in Horsens 8700. According to the local fire department, a resident forgot to turn off the stove. #press
Frederik Handberg's avatar
frederikhandberg 11 months ago
Rewriting bad code is time-consuming. You clean up messy logic, refactor a function… and then something else breaks. I’m in the process of rewriting a lot of components in a personal project using NextJS. #dev #NextJS
Tried deleting a few notes to see if delete requests are being honored by relays. To my surprise, the notes are gone from all the relays I published them to. At least, I can’t find the notes anymore.
Nostr is not for everyone, and I don’t think it will ever be, and that’s okay. The reason why I think this is first of all because of the fact that notes can’t be deleted, as there is no way to verify all relays, so you can never be 100% sure. The second reason is that people are afraid of losing their keys and thereby permanently losing access to their Nostr identity. I like Nostr, because of no character limits on notes, it’s decentralized, and I feel free when using Nostr because of no stupid walled garden.
Seems like Primal still has got the problem where it’s not showing thumbnails for when you have uploaded a picture. This means, you have no way of knowing whether the picture is actually uploaded or not… Thought it’d have been fixed in Primal 2.0, but I guess not 😔
I’m surprised Primal does not blur NSFW images by default, and I can’t seem to find an option for it in settings. I know Damus applies blur by default (at least it did for me). Just checked the global feed on Primal (which I never do cause most on the global feed is garbage) and saw NSFW pictures. Glad I wasn’t in public cause that would’ve been hella awkward…
It’s not even December and we’re already getting snow in Denmark. Very unusual. ☃️