coding: dom tribute to conway

A small and rather low-performance DOM tribute to John Conway and his iconic Game of life.

The known rules are:
1.) Any live cell with fewer than two live neighbours dies, as if by underpopulation.
2.) Any live cell with two or three live neighbours lives on to the next generation.
3.) Any live cell with more than three live neighbours dies, as if by overpopulation.
4.) Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

The fascinating aspect of the game is that there is no known algorithm that can predict for how many generations an initial setup will survive. It could be 1, 10 or 10000, it could run for 1.000.000 generations and still go extinct in the 1.000.001.

coding: hexagons in a spiral grid

Had some obsession with hexagons lately while planning for a hobby project I want to build some time in the future, result of it is this trippy rainbows demo, drawing hexagons in a spiral grid.

The longer you let it run, more trippy it gets 🙂

click to run

coding: rendering 10.000 svg icons

A quick performance test on what is the best approach to render 10.000 SVG icons.

Read more »

coding: quick setup for husky with lint-staged

1.) Install dev dependencies:

npm install husky lint-staged eslint --save-dev

Note: if you get an error like

ENOENT: no such file or directory, mkdir 'node_modules/husky/.git/hooks'
husky > Failed to install

just update your git to latest version and it should install fine.

2.) Update package.json with husky and lint-staged definitions by adding:

 ...
 "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{js}": [
      "./node_modules/.bin/eslint --fix",
    ]
  }
  ...

Note: you may want to also add ts or jsx like {js,jsx,ts} depending on what kind of setup you are working on

This is the very basic setup – for all extra consult the docs: https://github.com/okonet/lint-staged

articles: oneplus one OS upgrade

It’s been past 5 years since OnePlus released their first model One and this is still my main phone today. You may question why, but in reality except boosting specs and increasing camera picture quality, nothing impressive really happened in the phone tech, that would make me want to buy a new cutting edge phone (if I want quality pictures I use my DSLR, but also as a software developer I already have access to all the latest phones at work, so I really have no incentive of buying a new personal phone, not even just for fun).

But as time passes, I’ve also got a challenge idea – how long can I keep using this phone without having to give up any new app features, deal with slowdowns or let’s hope not breaking it (although I could replace the screen just for the sake of seeing how far I can go) .

Read more »

coding: eventko v2

For a few years I’ve been running a daily events collector that pooled Facebook events for our capital city Ljubljana from a curated list of venues. Unfortunately in 2018 Facebook limited the amount of data that you can get from their Graph API, so my events collector stopped working.

Since the Facebook events feed on their main website is still messy and the event results returned there are cluttered with a lot of content I really do not care for, I re-wrote the events collector.

You can visit it here: https://eventko.easwee.net/

List is updated once per day and pulls in events from ~170 venues in Ljubljana. The whole app runs on Node.js on a EC2 Linux instance. Cron job is triggered daily to collect fresh events and store them to a temporary database. I do not keep any old events – only future events are collected, old data is dumped every morning, in order to keep the AWS costs to a minimum.

This project is probably useless to the larger global population, but I believe it can be handy to the citizens of Ljubljana, who can have a clean source of quality daily events (concerts, movies, theater, public educational events, exhibitions,…).

In the future I hope to come up with more projects like this, that cater to a local community, but bring tailored content that may suit it better, than the results you would get on big websites.

It was fun to build.

coding: migration

After 12 years since easwee.net was first registered, I decided that it’s time to move from a managed to a dedicated hosting to support new exciting projects. Migration is now done, including all of the subdomains and hosted files, so easwee’s network now runs on a more mature setup.

Stay tuned for interesting new future projects!

coding: PDF invoice generator

As mentioned in my previous post I’ve been trying out Svelte for the last few weeks. Considering making the classic TO-DO app demo sounded a bit boring, I decided to build something more useful for myself – so I’ve put together an invoice generator that allows me to generate invoices for my company faster, compared to using a spreadsheet, as I used to do it until now.

It’s free to use and GDPR compliant, since all of the data you input is stored into IndexedDB, which lives inside your own browser only and is never sent to any server. A cheap but fast solution (avoiding to do any auth) . Once you set up the template, you will have it ready each time you return back. So you just update the client and invoice rows and generate a new PDF.

>>> Check it out on this subdomain: https://invoicer.easwee.net/

Hope you find it useful.

articles: svelte app development experience

This is a short write-up after completing a single page app project in Svelte.

The goal was to create an invoicing app that allows me to generate invoices for my company and export them into PDF with minimal click steps. It also includes conversion rates API fetching to support on-the-fly $ to € conversion, and simple client-side data storage inside IndexedDB, to prevent having to write in company data each time – ideal for recurring monthly invoices (I did not want to deal with setting up a server and database and user authentication at this point).

Read more »

coding: morse code; text-to-morse translator

The invention of the telegraph as the first electrical telecommunications system is an important landmark in the history of communication, but while the tech itself is very interesting hardware, from the coding point of view I’m more interested in the Morse code used to send messages with it.

Morse code consists of dots, dashes and spaces which when linearly combined and transmitted make up letters, words and sentences. Named after Samuel Finley Breese Morse who helped co-develop it, it was later refined by Friedrich Clemens Gerke and after the adoption by the Deutsch-Österreichischer Telegraphenverein (German-Austrian Telegraph Society) in 1851, we’ve got the International Morse code in 1865, which, while slowly declining in usage and making way for better ways of communication, stayed in use up to this days and that’s the alphabet set we are gonna use to code our text-to-morse translator in Javascript.

Read more »
Previous page