A software engineer with a penchant for working with Web Platform features and hacking on small projects has created posts and notes on this website.
Posts
- Web Performance — From the Lab to the Field In this post, I delve into the world of web performance and its profound influence on user experience. I share my experiences of optimizing my website, koddsson.com, by using real user monitoring and tools like Lighthouse CI.
- Implementing View Transitions on koddsson.com How I implemented MPA View Transitions on koddsson.com
- Stop trying to make things perfect A blog post with some thoughts on perfectionism
- Emojis as favicons A blog post describing how to use JavaScript to quickly set a websites favicon to a emoji
Images
Notes
-
I hate starting to create slides for a project or presentation. In most situations, I’ve forgotten context or other things which makes it time consuming to finish. I try to avoid the last-minute rush by starting my slides early. Instead of waiting until I have everything perfectly planned out, I open Google Slides right away and create a new deck. Then, I just start tossing in context, data and bits and bobs as soon as I experience or find it. As I go, I loosely group related content together, moving slides around as the structure starts to take shape. It doesn’t have to make sense at first.
As the days pass, I gradually refine the content. By the time the presentation is close, I’m not scrambling to put everything together—I’m just making small improvements and fine-tuning the details.
This way of working feels much easier than the stress of procrastinating and then rushing to throw everything together at the last minute. Instead of feeling overwhelmed, I can gradually shape the slides over time, making the process far more manageable. Plus, by the time I present, I already feel comfortable with the material since I’ve been engaging with it over time, rather than rushing through it at the last minute. If you tend to procrastinate on slides and then stress about them at the last minute, give this approach a try. I find it makes the whole process a lot more manageable.
-
Since bookmarks can be JavaScript we can dynamically create a URL based on some data. In this case the data is the current date. We'll use that to create a GitHub search filter for pull requests created in the last 7 days.
const today = new Date(); const lastWeek = new Date(new Date().setDate(new Date().getDate() - 7)); const created = [ [lastWeek.getFullYear(), lastWeek.getUTCMonth() + 1, lastWeek.getDate()].join("-"), [today.getFullYear(), today.getUTCMonth() + 1, today.getDate()].join("-"), ].join(".."); const url = new URL("https://github.com/pulls"); const params = new URLSearchParams(); params.set( "q", 'is:pr author:@me is:closed created:' + created ); url.search = params.toString(); window.location.href = url.toString();
Then we just need to compress the JavaScript, URL encode it, stick the
javascript:
protocol in front of the script and stick it in a URL. You can drag that into your bookmarks bar and now you have a easy shortcut to the work you did last week, ready for your next Monday standup!Note that you'll need to update user name (author:koddsson
) in the original script and then recreate the bookmarklet again to get your pull requests. I used https://caiorss.github.io/bookmarklet-maker/ to create my bookmarklet.Edits:
2024/10/21: @carlocab_ pointed out that I can use
author:@me
instead of hard-coding a username in the script.