Interesting, I just did http://nlsn.cf/54 . I just found a "bug" that can be abused (in chrome at very least). URL('http:53') returns https://0.0.0.53 (it casts the int32 number to an ip address, dont' ask why). But window.location.replace behaves differently and treats it as a relative URL.
Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
141–150 of 182 posts
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#142> Unlike many URL shorteners, this one does not need a database and can be entirely hosted on GitHub pages. it does need a database though. it just uses someone else's database
A URL shortener can be done with no database - I did it using only Lambda functions once, but I wouldn't recommend it. :) https://kevinkuchta.com/2018/03/lambda-only-url-shortener/
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#143This currently uses about 100KB of JavaScript (over 99KiB of polyfills, about 3KiB of actual code), loading the HTML file, then three JavaScript files, then making an API call to GitHub, then finally doing the actual redirect, by a substantially inferior JavaScript technique. Also, it doesn’t work on IE because the polyfills were insufficient. Yes, this is an interesting technical demonstration of a concept, but it a…
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#144I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free. Thus, I wrote this URL shortener which does not need a backend to work at all. It uses GitHub issues as a "database", and unlike most other URL shorteners that do not need backends, this one doesn't need a # prefixed to the…
"I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free." I felt exactly the same way and did, in fact, build one.[1] It was pretty simple. There's an interesting twist to the particular one I built - it's not specifically a URL shortener, it's a "Universal Shortener".[2] Also no…
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#145Babel though? Packages? JavaScript? This could just be a single HTML file, surely?
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#146Earlier quoted context omitted.
A URL shortener can be done with no database - I did it using only Lambda functions once, but I wouldn't recommend it. :) https://kevinkuchta.com/2018/03/lambda-only-url-shortener/
Haha this is fantastic. Are the IDs still coming from that single counter lambda? Or put another way, do you now have 1,750,785 lambdas in your AWS account? :)
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#147Earlier quoted context omitted.
A URL shortener can be done with no database - I did it using only Lambda functions once, but I wouldn't recommend it. :) https://kevinkuchta.com/2018/03/lambda-only-url-shortener/
I've seen people suggest using pi as a "database." In this instance you could map ranges of pi to characters. Then you search pi until you find the right range. The URL would contain the range(s) needed. This is terrible and so computationally wasteful. But it's interesting to think about.
Also, conceptually, it seems like you're not so much using pi as a database as you are using it as an encoding mechanism: turning "abc.com" into a string of numbers whose length is relative to the original string. At that point you might as well pick an easier encoding, like base64. :)
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#148Earlier quoted context omitted.
I've seen people suggest using pi as a "database." In this instance you could map ranges of pi to characters. Then you search pi until you find the right range. The URL would contain the range(s) needed. This is terrible and so computationally wasteful. But it's interesting to think about.
In a similar vein, almost every algorithm can be converted into a O(1) space version simply by converting it into the dumbest possible search algorithm over the solution space: just sample from the solution space randomly (with a seeded PRNG or something) until you get the right answer. A well-known example of this is bogosort: https://en.wikipedia.org/wiki/Bogosort
In the Turing machine model of computation, algorithms that use O(1) space are theoretically equivalent to finite state machines (potentially with a very large number of states). Logarithmic space is where things start to get interesting, because it's enough to store a constant number of pointers into an arbitrarily large input.
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#149Earlier quoted context omitted.
"I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free." I felt exactly the same way and did, in fact, build one.[1] It was pretty simple. There's an interesting twist to the particular one I built - it's not specifically a URL shortener, it's a "Universal Shortener".[2] Also no…
Since we're on HN, and this isn't addressed in either FAQ: did anyone end up paying for custom codes?
I've spent almost zero time on "Oh By" in the last 24 months as things at rsync.net have been very busy. So, we haven't made a sale in months due to lack of publicizing it.
However, I think there are unknown, emergent use-cases out there for "Oh By" that I hope people will discover. I am going to pivot back to "Oh By" next year ...
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#150Earlier quoted context omitted.
"I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free." I felt exactly the same way and did, in fact, build one.[1] It was pretty simple. There's an interesting twist to the particular one I built - it's not specifically a URL shortener, it's a "Universal Shortener".[2] Also no…
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!
I also sent a notice to all rsync.net customers, years ago, when we launched it.
That's it.