https://www.gravatar.com/avatar/e88f6d7fc9ca9630fab20d6157f43196?s=240&d=mp
Learning and sharing. Code, ideas, DIY, thoughts and more.

Advent of Code: 2020 Day 04 solutions

SPOILER ALERT This is a post with my solutions and learnings from the puzzle. Don’t continue reading if you haven’t tried the puzzle on your own yet. If you want to do the puzzle, visit adventofcode.com/2020/day/4. My programming language of choice is python and all examples below are in python. Key learnings Debugging and testing Todays puzzle has a number of specific requirements to follow. The key learning I took away from it too handle edge cases, follow specification and having a systematic way of debugging.

Advent of Code: 2020 Day 03 solutions

SPOILER ALERT This is a post with my solutions and learnings from the puzzle. Don’t continue reading if you haven’t tried the puzzle on your own yet. If you want to do the puzzle, visit adventofcode.com/2020/day/3. My programming language of choice is python and all examples below are in python. Key learnings Functions and abstraction Part 1 is solved using the learnings from the previous days. Part 2 introduces a new key learning.

Advent of Code: 2020 Day 02 solutions

SPOILER ALERT This is a post with my solutions and learnings from the puzzle. Don’t continue reading if you haven’t tried the puzzle on your own yet. If you want to do the puzzle, visit adventofcode.com. My programming language of choice is python and all examples below are in python. Key learnings String handling This puzzle teaches you to handle strings. They are handled differently in every programming language and it’s valuable to get comfortable with them.

Advent of Code: 2020 Day 01 solutions

SPOILER ALERT This is a post with my solutions and learnings from the puzzle. Don’t continue reading if you haven’t tried the puzzle on your own yet. Key learnings For-loops If statements You need to understand loops and if-statements to solve the puzzle. You can make it more advanced by optimizing the solution, then there are some more key learnings. Though the input is small enough that no optimization is needed.

Image Optimize for web

Here is a walkthrough of steps I took to optimize images for my blog synille.se. First of, there are some good tips to follow: Use JPG for photoimages. PNG for graphics with large flat-color areas. SVG for icons if you have. File-names: Short, small letters, no symbols or sign, and descriptive for SEO. Max-width: 2500px for full-width images. 800px for “in article” images. Never have an image over 500kb. Imagehandling with Imagemagick For handling the image sizes and quality I used the tool imagemagick.

Goatcounter

This are the steps I took to install goatcounter on a EC2 (AWS). The counter is put behind a nginx server. Using letsencrypt for SSL. Step 1: Install goatcounter on server Downloaded latest release for linux(AMD64) Link: https://github.com/zgoat/goatcounter/releases Transfer the binary to your server with SCP. scp ./goatcounter-v1.1.2-linux-amd64 ec2:~/ Step 2: Create server SSH into your EC2 and run: ./goatcounter-v1.1.2-linux-amd64 create -email EMAIL -domain DOMAIN Where email is your admin-email and domain is the domain where the goat-server will be placed.