Projects
30 Oct 2023
In English, the phrase “rule of thumb” refers to an approximate method for doing something, based on practical experience rather than theory.
This project’s aim is simple. To provide some rough baseline measurements for common decisions you have to do every day as a software engineer:
Do I use map or a slice here?
TL;DR: use map when len(haystack) > 100 && len(needles) > 100
I need to deduplicate this, do I use map[T]struct{} or just deduplicate the slice?
TL;DR: use map when len(haystack) > 100. Use slice when the elements are pre-sorted.
There is many more in the repository. There are so many discussions like these in every engineering team. It often comes up in code reviews - “you should use *struct here instead of copying”. OK, but why? At what point is it beneficial?
22 Apr 2020
As is a library to convert numeric types with overflow check in Go.
Why?
Other languages like Rust have overflow checks on type casts (if you use TryFrom and not just as), but for Go there is nothing like that.
My need came from a simple bug, where external integer type was being type casted multiple times across multiple API boundaries. Because the original integer size was hidden across several API hops, the affected code expected too small integer size, and overflowed.
16 Jun 2019
Given my passion for Sci-Fi and all things related to space, it’s only natural that EVE Online has captured my heart.
What is EVE Online?
Eve Online is a massively multiplayer online game (MMO) set in a science fiction universe, known for its complex player-driven economy and expansive sandbox gameplay. In the game, players pilot customizable spacecraft across a vast universe, engaging in various activities such as exploration, mining, trading, combat, and diplomacy. The game offers a highly immersive experience with a rich backstory, player-driven events, and a dynamic political landscape shaped by the actions of individual players and player-run corporations. Eve Online is renowned for its depth, complexity, and emergent gameplay possibilities.
11 Nov 2018
Recently I read this awesome article about representing hexadecimal numbers using runic system. So I created this little program that takes hexadecimal string on stdin and spits out SVG data on stdout.
To make it easier, and also to learn about state of Rust’s HTTP frameworks, I wrote a small HTTP server for this, and it is open to the public.
Lessons learned:
29 Jun 2018
Nanny is a monitoring tool that monitors the absence of activity.
Nanny runs an API server, which expects to be called every N seconds, and if no such call is made, Nanny notifies you.
Nanny can notify you via these channels (for now):
- print text to stderr
- sentry
- sms (twilio)
- slack (webhook)
- generic webhook (HTTP POST callback)
- xmpp (jabber)
Usecase?
Ever wrote invalid crontab record? Ever had it call bash script that failed silently without doing what you wanted, and you noticed months later? Thats why.
1/2