Thoughts on Deno

Deno: Unleashing the Power of JavaScript/TypeScript Runtimes Hey there, fellow developers! If you’re into JavaScript or TypeScript, you’ve probably heard about Deno, the brainchild of the brilliant mind behind Node.js. Deno takes everything we loved about Node.js, learns from its flaws, and introduces some exciting new features that make coding a breeze. Let’s dive in and explore what makes Deno so special! Taking Control with Granular Permissions Picture this: you’re building an app, and you want to ensure it has access to only the necessary resources....

June 30, 2023

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....

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....

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....

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....

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....

August 5, 2021

Say goodbye to grep

ack is a famous code search tool to replace grep (in a lot of use cases): https://beyondgrep.com/why-ack/ Now there is something even better. There is ag aka The Silver Searcher: ggreer/the_silver_searcher It is like ack, but faster. Why not just grep? Hella fast. Like really really fast. It is beautifully optimized C. It ignores files from .gitignore Instead of doing this with grep: grep -R --exclude-dir=node_modules 'foobar' /path/to/your/code You can just do (if you have node_modules in your ....

July 25, 2021