Recent submissions

Comment · 4 years ago
Comment · 4 years ago
Nice thats what i do too! I use a combination of code-server running on a gcloud instance and chrome remote desktop to do my work on a lenovo duet chromebook!
Comment · 6 years ago
Cuz they are supposed to be called by people building various apps, and it does not make sense to limit the source of the network requests
Comment · 6 years ago
Thank you for the reply! I definitely learnt a lot from your comprehensive replies. Personally, I am just getting started in web development and I have traditionally written everything with the help of frameworks like ReactJS and the like and the abstractions these frameworks provide means I actually don't know the nitty gritty of how things work. Cross browser compatibility or efficiency was definitely not something I considered and they are definitely very valid considerations. And HTTP redirects via service workers sounds damn interesting! I will go read up on those now! Thank you for the comment I did learn a lot and will work these suggestions into the code base when I do have the time :')
Comment · 6 years ago
Wow.. I don't even know where to start.. Thanks for the heads up that's cool beans!
Comment · 6 years ago
Base64 would probably be longer than the original URL. I can't really see how short pieces of text (like URLs) could be compressed to become smaller. That being said it's definitely a cool concept! I once worked on a code playground kinda thing for my school and there was a function to share the code written in a URL. How we did it was just to include the whole piece of code as a URL param in base64!
Comment · 6 years ago
Oh that is cool! It does remind me of https://telegra.ph/ by Telegram! (Even though they weren't really advertising it as a universal shortener). Just a quick question, how did you promote your platform!
Comment · 6 years ago
I would suppose doing a push every time a new URL is added would be quite expensive for GitHub too. Plus, GitHUb pages is not updated immediately upon push and it takes some time for new links to work. That being said, this is definitely not the most realistic implementation of a URL shortener. It is meant to be cool and hacky and definitely not used for production!
Comment · 6 years ago
Well I would believe that even a `json` file or any other form of storage written to disk is considered a database, But your suggestion definitely brings it further away from an actual database!
Comment · 6 years ago
I do have YOURLS on my personal domain/server. It does work well for me and has no spam as link creation can be made private!
Comment · 6 years ago
Indeed and especially with many shorteners not being maintained and going down. That being said, this one is not meant to be an actual URL shortener, but rather, a cool hack and it is not meant to be used widely or used in production.
Comment · 6 years ago
Hmm having a GitHub action redeploy the site is not instantaneous and it does take up to 1 minute for the site (and consequently the new short link) to be updated. Nevertheless, that is a sweet idea, and there are other replies that suggested using a static site generator to generate one html file per short link, with each html file containing a "redirect" tag in <head>. This idea can definitely be combined with a GitHub action. Personally I feel that is overkill, because if I were doing something so elaborate, I would have opted for a simpler and more scalable option like Google Cloud Firestore or Firebase URLs
Comment · 6 years ago
I am calling GitHub's official API. APIs are not supposed to have any CORS restrictions.
Comment · 6 years ago
If the links were to be stored in files, I probably would run a GitHub action on every push to statically generate the pages for new links!

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton