Damerau-Levenshtein in the browser or: How I almost lost my mind!

Call me lazy, but when I’m prototyping something. I want to just be able to <script src=" a library quickly. I don’t want to npm, webpack or any such nonsense, if I’m just quickly winging it. Now most of the time it’s wonderful, I can just find a url from jsdelivr or some other CDN that has been minified and ready to be sourced. But sometimes you can’t. This is one of those times. ...

February 18, 2025

Thoughts on Deno

I originally asked chatGPT to write this article. Just to test chatGPT out. I forgot to mention that I wrote it with chatGPT and it was absolutely an embarrasing piece of writing. It looked like a machine wrote it. The topic of article is still very interesting. Now maybe more than ever. Because Deno 2.0 has been released. JSR exists. After about two years (?) of using Deno what can I say about it that hasn’t been said. Nothing. But I want to give my input. ...

November 13, 2024

VIM and PHP

To make VIM work more like VSCode, you really want to install VIM plugin called CoC. It adds LSP features to VIM and makes it easy to port VSCode extensions to Vim, and it has great, mature ecosystem: https://github.com/neoclide/coc.nvim To get PHP language server features, you want to install a PHP language server extension for CoC: https://github.com/marlonfan/coc-phpls This extension uses Intelephense in the background and makes it so that you can jump to definitions etc. But some of the features that you are used to have with language servers are missing unless you get premium licence for Intelephense. Like renaming variables. ...

October 25, 2022

Speed Reader App

I have been using this great speed reading webapp called Spreeder. It prints out one word at a time to the middle of the screen. It prints them out at 300WPM by default (raising the average reading speed of 200WPM). It is very effective for short bursts at least. Link to Spreeder: https://www.spreeder.com/app.php?intro=1 I was wondering if I could dev this in one day (more or less). Here is the result: https://nake89.github.io/speed-reader/ ...

September 16, 2022

How to get history to work in vim mode zsh

When enabling vim mode in zsh it will make pressing ctrl+r not show terminal history anymore. It gets rebound to terminal refresh which is not necessary. To renable ctrl+r append this to your .zshrc: bindkey "^R" history-incremental-search-backward Now close the terminal and reopen it (or just type . .zshrc) and you are done.

August 12, 2022

How to enable vim mode in zsh

Vim mode let’s you use vim keys. You start in insert mode and esc let’s you go into normal mode. To enable vim mode append the following snippet to your .zshrc in your home directory. # Enable vim mode. bindkey -v Now close the terminal and reopen it (or just type . .zshrc) and you are done.

August 12, 2022

WPAIO.one - What Page Am I On?

I wanted to see if I could create and publish an app (website) in one day. This app had to have some practical value. An app to keep track of the current book I am reading (Tom Clancy’s Oath of Office). I do use a bookmark, but it is very thin and I wanted an app where I can enter the page I’m currently on. So I created https://wpaio.one

November 16, 2021

Local development is a joke (sometimes)

Local development has many benefits. When you can edit something on your local development machine and see the changes immediately (hot-reload), it makes the feedback loop smaller and makes development that much faster. Different toolkits have different ways of trying to solve local dev. Serverless Offline is a plugin for the Serverless Framework simulates AWS Lambda and other serverless providers to give a working offline version of that serverless app you are trying to create. So instead of calling e.g. https://12312321.execute-api.eu-north-1.amazonaws.com/dev you would call http://localhost:3000/. There is LocalStack which will emulate the whole AWS ecosystem. And most front-end frameworks have some sort of hot-reload enabled toolkit. ...

October 15, 2021

Passwords in Email

It happened again. I created an account to a service (a domain registrar) and their welcome email contained the password I just gave them. You might think that that is fine, because maybe they didn’t store that password plain text in their DB. Maybe they hashed it. If you are confused about what hashing means, then read this auth0 article. Hashing in short: Normally passwords are stored in the database in a cryptographically secure manner, called a hash. This hash cannot be reversed to the password. Unless bruteforced, the stronger the password, the longer it will take, potentially up to tens/hundreds of thousands years (hashing algorithm and salting also can affect the difficulty in bruteforcing). This means that if somebody hacks the database, the attacker wont get all the customers’ passwords. ...

August 17, 2021

Add GSI to existing DynamodDB table (nodejs, aws-sdk)

If you are using the Serverless Framework, you can create DynamodDB and add one GSI (Global Secondary Index) with cloudformation syntax. How to add table: https://www.serverless.com/framework/docs/providers/aws/guide/resources/#configuration Here is the syntax to add GSI: https://cloudkatha.com/solved-cannot-perform-more-than-one-gsi-creation-or-deletion-in-a-single-update/ Official docs related to GSI cloudformation syntax: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html That’s all fine until you need to add another GSI. You can’t do that with Cloudformation syntax [1]. Luckily we can do that programatically with Node.js (you could also use another programming language and just use the related aws-sdk library: https://aws.amazon.com/tools/ ...

August 5, 2021