Custom Login With Nextjs and Amazon Cognito

Some prerequisites In this tutorial I assume you have yarn or npm installed and you can translate commands from one to the other. I will be using yarn here. I also assume that you have the AWS CLI installed and configured. During the configuration stage you will set an AWS user to run all your Amplify commands. This user needs to have all the relevant IAM roles attached to it....

Create and Verify a New User on a Cognito User Pool

If you just created a new Cognito User Pool and you want to add a new user fear not. You can add that user using the cognito interface but you won’t be able to do much with it as the user will need to be verified and change their password. Register a new user You can go to the user interface of your Cognito User Pool and add the user there....

An introduction to emacs via Spacemacs

Why Emacs I’m not going to bore you with things like “It’s made in the 70s” and “It’s super powerful” or any of those facts. For me it was because of org-mode. I read recently a book regarding a note taking method called Zettelkasten. The basic premise of the method is that every note you make you connect it with some other note, via tagging, and it eventually creates a graph....

Vi basics. Or how to quit vi

Lately I’ve been teaching myself a little bit of VI magic and migrating my writing to Spacemacs as an editor. I’ll be writing more about Spacemacs in the future so bare with me. For now here’s the list I have in front of me on my screen to navigate myself around VI. I will be adding more commands as I go. The very basic stuff :q - Quit vi :w - Write....

Seek first to understand, then to be understood

I first came across this quote from the book 7 habits of highly effective people by Stephen Covey1 and I actually found it very intriguing. The problem I found out judging from myself, and from other people, is that especially in times of critical conversations I wasn’t actively listening. Instead I would focus on the words and miss the meaning. A lot of people are also not even listening. Instead they would only think their reply or the next question to ask....

2020 keeping only the positives

My friend Sam posted this tweet the other day and she did inspire me. I, too, did a lot of memorable things this year. Positive things that I want to focus on. We had enough negative things coming our way from the media so you don’t need my blog post for that. Creating avcud.com In the beginning of the quarantine I wanted to watch the best movie for each year, starting from 1984....

TypeScript: Supercharging enums with modules.

When using a language like Java you can use enums to do some very interesting things. For example a Java enum can look like so: public enum Directions{ EAST ("E"), WEST ("W"), NORTH ("N"), SOUTH ("S") ; /* Important Note: Must have semicolon at * the end when there is a enum field or method */ private final String shortCode; Directions(String code) { this.shortCode = code; } public String getDirectionCode() { return this....

Moving from a Macbook Pro laptop to a Linux PC. The beggining of a journey.

I remember it was the early 2000s when I was reading on the web that this year is going to be the year of the linux on the desktop. Suffice to say that this year kept coming and coming time and again. For me the first interaction with Linux was with Redhat Linux sometime in 1998. A person I was talking on IRC sent me a CD that I installed on my PC....

TypeScript: How to check for types. Using tagged unions.

Working with TypeScript has been amazing. One of the most common things I’ve been finding my self checking was whether one variable is of a certain type. Let’s look at an example. interface Mammal { name: string; } interface Horse extends Mammal { canRun: boolean; } type Animal = Mammal | Horse; const animalThings = (animal: Animal) => { if (animal instanceof Horse) { // Error: 'Horse' only refers to a type, but is being used as a value here....

Serving optimized images with AWS S3, API Gateway and CloudFront.

I like photography and I like having a dedicated space to share my photos along with a little story behind it. Currently that space is a self hosted Wordpress website, with all the images in folders. It is served at DigitalOcean and it costs me 5$ a month. The URL for this is stefanis.studio. I wanted to simplify things and bring my photography content in a subsection of this website, but I don’t want to have all those photos in a folder here....