coding: blyat – brickout-like game done with godot engine

Tinkering with Godot features, this was a good learning project to get a small game done from start to end. 3 levels total.

HTML5 wasm build for preview:
https://sample.easwee.net/blyat/blyat_html/blyat.html

Forkable repository – feel free to grab:
https://github.com/easwee/blyat

coding: godot devlog dump part I

It’s been a few months since I’ve started playing with Godot engine and it has been an enjoyable experience.

Here I’m dumping a list of “aha moments” that I’ve pilled up while learning how to use it, hoping come handy to some other newcomer.

Read more »

coding: convert large .pbf to .map using osmosis

Prerequisites:
– osmosis
– mapsforge-map-writer plugin
– as much free HD space as possible

Download Osmosis and mapsforge-map-writer plugin as specified in their docs (as of writing this I used osmosis-0.48.2 and mapsforge-map-writer-master-20200902.143123-360-jar-with-dependencies.jar). Inside of /osmosis root folder create a /plugins folder and put mapsforge-map-writer-<version>-jar-with-dependencies.jar inside it.
You can run Osmosis from /bin folder – if any additional plugins are present inside the /plugins folder, you will be able to use additional options when running commands.

By default Osmosis runs in-memory (default type=ram), however for large map conversions, it can run out of memory and even allocating more (JAVACMD_OPTIONS=-Xmx8G or more) is sometimes not enough (throwing OutOfMemory: Java heap space).

Switching to type=hd, it offloads the temporary data to your hard drive:

osmosis --rb file=your_map_file.pbf --mapfile-writer file=converted_file_name.map type=hd

Above command will store temporary files in your OS temporary folder location instead of using memory, but the process itself takes more data, so you need a larger amount of free space compared to running type=ram

Note: You can run java -XshowSettings and check java.io.tmpdir value to see your temporary files location. In case your drive is full, it can be changed to another drive if you need more space. To convert a ~2.5GB .pbf file I needed ~50.0GB of free space for temporary files. I did the conversion on a Windows 10 machine, but it works the same on Linux.

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!

Previous page