<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Piotrek Zając 🇵🇱</title>
    <description>The latest articles on DEV Community by Piotrek Zając 🇵🇱 (@unixslayer).</description>
    <link>https://dev.to/unixslayer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F211378%2F38820c32-7ce0-401f-affa-8bb82f714b43.jpeg</url>
      <title>DEV Community: Piotrek Zając 🇵🇱</title>
      <link>https://dev.to/unixslayer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/unixslayer"/>
    <language>en</language>
    <item>
      <title>How I track work in my timelog</title>
      <dc:creator>Piotrek Zając 🇵🇱</dc:creator>
      <pubDate>Tue, 05 Jan 2021 14:52:53 +0000</pubDate>
      <link>https://dev.to/unixslayer/how-i-track-work-in-my-timelog-40jk</link>
      <guid>https://dev.to/unixslayer/how-i-track-work-in-my-timelog-40jk</guid>
      <description>&lt;p&gt;As a programmer who works with different tasks, projects and even teams it is important to be able to report work time either when settling with client, superiors or during the daily Scrum. There are some browser-based tools but they ain't comfortable when you have opened many tabs at once.&lt;/p&gt;

&lt;p&gt;There is a possibility to install an time tracking application on your phone. I was once using &lt;code&gt;Jira time tracker&lt;/code&gt; on my phone, which was connecting directly with company's Jira. Unfortunately in the long run this didn't work. Not because this was poor solution, but because I didn't took my phone everywhere with me. This was more common even to leave my phone at home rather than my computer. Later I sometimes forgot to fill my timelog, and who remembers what he/she did few days ago, or even yesterday? ;)&lt;/p&gt;

&lt;p&gt;There are also services like &lt;code&gt;Toggl&lt;/code&gt; which allows you to install a desktop application. HHere however I alway had some problems with how they work and integrate with Linux. For some reason desktop applications have better support on Windows or MacOS systems. &lt;/p&gt;

&lt;p&gt;Personally I spend much time with my hands on the keyboard and that is why best solution for me is the one that can well integrate with shell and easily allows to switch between activity context. Fortunately, such tool exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hamster time tracker
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Hamster&lt;/code&gt; can be installed on any Linux distribution. It provides a service that allows you to track your activities from command line. &lt;code&gt;Hamster time tracker&lt;/code&gt; can be installed with apt.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install hamster-time-tracker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I recommend to install &lt;code&gt;Hamster&lt;/code&gt; this way. There is a possibility for installing it via &lt;code&gt;snap&lt;/code&gt;, but at the moment snap won't allow for external services to launch user session dbus-services (&lt;a href="https://forum.snapcraft.io/t/need-help-dbus-activation-for-project-hamster-snap/11885"&gt;see related discussion&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;From now on, you can use &lt;code&gt;Hamster&lt;/code&gt; from your command line. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hamster help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Recording activity
&lt;/h2&gt;

&lt;p&gt;Activities can be categorized, tagged, filled with description and defined in the past if you forgot to report them. &lt;/p&gt;

&lt;p&gt;When you want to record an activity, you can simply type what you are doing and &lt;code&gt;Hamster&lt;/code&gt; will do the rest, but there is more to that which can help you track your time even better.&lt;/p&gt;

&lt;p&gt;To add activity &lt;code&gt;Hamster&lt;/code&gt; defines following syntax:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;activity name time @category name,, some description #tag #other tag with spaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Everything you pass at the begining will be used as an activity name. Time can be defined as a starting point, time period or have relative value, eg. &lt;code&gt;14:30&lt;/code&gt;, &lt;code&gt;11:35-12:00&lt;/code&gt;, &lt;code&gt;-5&lt;/code&gt; for &lt;code&gt;started 5 minutes ago&lt;/code&gt;. Using &lt;code&gt;@&lt;/code&gt; let you categorize your activity, double coma (&lt;code&gt;,,&lt;/code&gt;) is for description and &lt;code&gt;#&lt;/code&gt; can be used for tags. Be advised that &lt;code&gt;Hamster&lt;/code&gt; will handle empty spaces as part of a started section until it finds next special character.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hamster add doing something important -5 @project #tag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Hamster&lt;/code&gt; also allows you to export your timelog in such formats as &lt;code&gt;xml&lt;/code&gt;, &lt;code&gt;csv&lt;/code&gt;, &lt;code&gt;html&lt;/code&gt; and &lt;code&gt;ical&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hamster export tsv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;However there is more efficient way to track your time with &lt;code&gt;Hamster&lt;/code&gt; for those who use Gnome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gnome Shell Extension
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Hamster shell extension&lt;/code&gt; available on &lt;a href="https://extensions.gnome.org/"&gt;Gnome extensions website&lt;/a&gt; is outdated however it is realy straight-forward to install it by yourself. Start from cloning official repository.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/projecthamster/hamster-shell-extension.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Make sure, that you are on &lt;code&gt;develop&lt;/code&gt; branch&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Repository contains a Makefile that allows you to build and install this extension in your home directory. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make install-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;During compilation, I got the following result&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ make dist
cp -R extension/* build
cp -R data/* build
glib-compile-schemas build/schemas
find build -name \*.po -execdir msgfmt hamster-shell-extension.po -o hamster-shell-extension.mo \;
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
find: ‘msgfmt’: No such file or directory
mkdir -p dist;
cd build; zip -rq ../dist/contact@projecthamster.org.zip ./* || true
cd build; tar -czf ../dist/contact@projecthamster.org.tar.gz *
total 112
-rw-r--r-- 1 marc marc 46418 mar 19 11:05 contact@projecthamster.org.tar.gz
-rw-r--r-- 1 marc marc 65436 mar 19 11:05 contact@projecthamster.org.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is related to translations compilation and can be solved by installing &lt;code&gt;gettext&lt;/code&gt; package.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install gettext
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To finalize, we may have to restart Gnome Shell. To do that press &lt;code&gt;Alt+F2&lt;/code&gt;, type &lt;code&gt;r&lt;/code&gt; and hit &lt;code&gt;Enter&lt;/code&gt;. Last thing I do is to disable &lt;code&gt;&amp;lt;super&amp;gt;+h&lt;/code&gt; shortcut which hides current active window. &lt;code&gt;Hamster extension&lt;/code&gt; binds to it, and since I dont use it, I can disable it. You can either do the same as I, or can also change extension shortcut by looking for &lt;code&gt;Hanster time tracker&lt;/code&gt; on installed extensions list and go into preferences.&lt;/p&gt;

&lt;p&gt;Each time we start doing something, we can hit &lt;code&gt;&amp;lt;super&amp;gt;+h&lt;/code&gt;, type current activity, hit &lt;code&gt;Enter&lt;/code&gt; and &lt;code&gt;Hamster&lt;/code&gt; will ... start tracking time ;) Shell extension uses the same syntax as command line with one difference - if defined, time must be passed at the beginning.&lt;/p&gt;

&lt;p&gt;Currently ongoing activity should be visible on the top bar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vLURjC5P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://unixslayer.github.io/assets/hamster-top-bar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vLURjC5P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://unixslayer.github.io/assets/hamster-top-bar.png" alt="hamster-top-bar"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>timetracking</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Firing a cannon at ants</title>
      <dc:creator>Piotrek Zając 🇵🇱</dc:creator>
      <pubDate>Wed, 12 Aug 2020 07:23:11 +0000</pubDate>
      <link>https://dev.to/unixslayer/firing-a-cannon-at-ants-3ml1</link>
      <guid>https://dev.to/unixslayer/firing-a-cannon-at-ants-3ml1</guid>
      <description>&lt;p&gt;The solutions should be tailored to the problem. This is a fact that is hard to disagree with. Listening to Mariusz Gil and Kuba Pilimon in podcast about &lt;code&gt;Large-scale structures&lt;/code&gt;, something hit me. Very often you can hear something like "it won't work in every project" or "with smaller projects, it's a waste of time" from experienced experts sharing their knowledge.&lt;/p&gt;

&lt;p&gt;Some time ago I got a simple project to do. The application was to accept payment orders, execute it in the PSD2 standard and return the payment status, which may actually be processed only after some time. I decided to try a new approach and implement this project using &lt;code&gt;DDD&lt;/code&gt;, &lt;code&gt;CQRS/ES&lt;/code&gt;. I started by organizing an &lt;code&gt;Event Storming&lt;/code&gt; session. Two &lt;code&gt;Process Level&lt;/code&gt; sessions, 3 hours each, and several smaller &lt;code&gt;Design Levels&lt;/code&gt;. The domain turned out to be very simple, and the aggregates that were created - almost anemic. The &lt;code&gt;C4&lt;/code&gt; model was also created :) The only thing that went beyond &lt;code&gt;CQRS/ES&lt;/code&gt; were very low-level elements, such as communication with Banks' API.&lt;/p&gt;

&lt;p&gt;Later I got another project. There was an application to be done that sends e-mails. Such with reports or notifications. The user wanted to be able to define message templates and order shipping in a fairly simple, but at the same time complex way. Here the domain was discovered with the help of &lt;code&gt;Event Modeling&lt;/code&gt;. Lesson learned from my previous project, and I know what questions to ask during the workshop, how to organize the application architecture, what to pay attention to so I won't have to rewrite half the code at some point, how to implement events, how to extract subdomains and &lt;code&gt;Bounded Contexts&lt;/code&gt;. The project, as it turned out, was a bit more complex than the previous one and introduced some new elements, such as the &lt;code&gt;Process Manager&lt;/code&gt; pattern, which allowed for solving several complications that appeared. However, it was still a small scale in terms of the way it was implemented.&lt;/p&gt;

&lt;p&gt;Now I'm starting another project. The previous ones turned out to be so well implemented that I was entrusted with providing the Affiliate Program application. Discovering the domain is still ongoing process - I'm after a few &lt;code&gt;Big Picture&lt;/code&gt; sessions and in the middle of &lt;code&gt;Process and Design Level&lt;/code&gt;, I already know that I will carry out this project in the same way as the previous ones. The project turns out to be much more complex, but instead of discovering new techniques, I extend the scope of those that I have already learned and slowly introduce new elements.&lt;/p&gt;

&lt;p&gt;The arguments quoted in the introduction may be applicable only to projects that will not run for more than a few weeks. Then the development really should not be longer than the estimated lifetime of such an application. But one day a really big and ambitious project may come up. Should you wait for such a project to start using large and ambitious tools?&lt;/p&gt;

&lt;p&gt;It's good to learn to shoot a cannon. If we shoot ants with it, possible losses will be small. It's just ants, after all. But when we hunt for big game, it seems to me that it is probably better to be prepared for it. Otherwise, we may be trampled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bettersoftwaredesign.pl/episodes/9"&gt;On a model and large-scale structures with Kuba Pilimon (PL)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>workshop</category>
      <category>experience</category>
    </item>
  </channel>
</rss>
