I’m currently [[replacing-google-search-apps-with-self-hosted-web-apps]] and
decided to create a simple b64 encoder/decoder, just start typing to enter
text, escape to deselect, then e/d to encode/decode.
I’m trying to make these apps super simple, self hosted [1] out of minio, static
html [2], and javascript. It’s been fun to get back to some simple interactive web
development like this. No build just a website that does something. No broken
builds, no containers to deploy, just push to minio.
encoded = btoa(content);
decoded = atob(encoded);
Here is the result.
[3]
References:
[1]: /self-host/
[2]: /html/
[3]: https://b64.wayl.one
Posts tagged: javascript
All posts with the tag "javascript"
4 posts
latest post 2025-05-25
Publishing rhythm
encodeURIComponent() - JavaScript | MDN
The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will ...
MDN Web Docs · developer.mozilla.org [1]
In order to send data that includes special characters such as / in a url you need to url encode it. You have probably seen these many times in urls with things like %20 for spaces.
I’m working on a chrome extension to make quick blog posts, like thoughts or a persistent bookmark tool with comments. The backend is written in fastapi [2] and when I check to see if I have a post for a page I need to url encode it.
curl -X 'GET' \
'https://thoughts.waylonwalker.com/link/?link=https%3A%2F%2Fhtmx.org%2Fextensions%2Fclient-side-templates%2F' \
-H 'accept: application/json'
curl example generated from the fastapi swagger docs.
Here is how I used javascript’s encodeURIComponent to turn my chrome extension into a notification when I already have a post for the current page.
// Event listener for tab changes
chrome.tabs.onActivated.addListener(function (activeInfo) {
// Get the active tab information
...
How to get Dev Comments from an article Url
I want to incorporate some of the wonderful comments, \U0001F495, \U0001F984,
and \U0001F516’s that I have been getting on dev.to on my website. I have
dabbled once or twice with no avail this time I am taking notes on my journey,
so follow along and let’s get there together. By the end of this post, I will
have a way to get comments from posts on the client-side thanks to the
wonderfully open dev.to API.
I want to incorporate some of the wonderful comments, 💕, 🦄, and 🔖’s that I have been getting on dev.to on my website. I have dabbled once or twice with no avail this time I am taking notes on my journey, so follow along and let’s get there together. By the end of this post, I will have a way to get comments from posts on the client-side thanks to the wonderfully open dev.to API.
The API # [1]
dev.to has an open API that allows us to easily get comments as HTML [2]. They have their API hosted at https://docs.forem.com/api/#tag/comments, let’s take a look at it.
[3]
Here we can...
Explicit vs Implicit Returns in Javascript
Often when reading through javascript examples you will find some arrow
functions use parentheses () while others use braces {}. This key
difference is that parentheses will implicitly return the last statement while
braces require an explicit return statement. It is important to understand the
difference between them because it is likely that you will find code examples
of both and trying to edit code written differently than you’re used to may
have unintended consequences.
[1] # [2]
Arrow functions are one-liner functions in javascript that have two main syntactical ways to create the code block. with parentheses and braces. Let’s take a look at both ways of creating arrow functions so that when we come accross them in the wild it will all make sense.
[3] # [4]
Here is an example of an arrow function that will implicitly return the last
statement without the return keyword. I believe that these are a bit more restricted
in that you cannot set variables inside them. They are ...