<?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: Anmol Shukla</title>
    <description>The latest articles on DEV Community by Anmol Shukla (@cazaimi).</description>
    <link>https://dev.to/cazaimi</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%2F171454%2F52c0ea7f-25bc-4cc3-9951-717ca373cb0f.jpg</url>
      <title>DEV Community: Anmol Shukla</title>
      <link>https://dev.to/cazaimi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cazaimi"/>
    <language>en</language>
    <item>
      <title>How I achieved clean inbox on Slack</title>
      <dc:creator>Anmol Shukla</dc:creator>
      <pubDate>Tue, 08 Dec 2020 20:30:58 +0000</pubDate>
      <link>https://dev.to/cazaimi/how-i-achieved-clean-inbox-on-slack-3kbp</link>
      <guid>https://dev.to/cazaimi/how-i-achieved-clean-inbox-on-slack-3kbp</guid>
      <description>&lt;p&gt;&lt;em&gt;Title image Credit: Helpscout (&lt;a href="https://www.helpscout.com"&gt;https://www.helpscout.com&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We've all heard of the inbox zero. It sounds like a distant dream, an empty screen signalling that all that you had needed to attend to, has been attended to. It's the logical equivalent to the 😌 emoji. It also, if guides and blogs are to be believed, takes a lot of effort, a logical equivalent of the 😫 emoji.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EhkP_OHB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ohl39xrv55grtzagx0pl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EhkP_OHB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ohl39xrv55grtzagx0pl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;em&gt;Credit: Slack (&lt;a href="https://www.slack.com"&gt;https://www.slack.com&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While that may be true for emails, I was able to achieve an Inbox zero (almost) in Slack, and I feel the bliss that comes along with it. Like the discovery of the X-rays, this discovery was too, accidental. Here's the algorithm that I follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Slack now supports sections, which are logical groups that you can make for your chats. More details here.&lt;/li&gt;
&lt;li&gt;Group up your channels however you'd like (I have 6 categories).
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nSSDmmuS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ekdp53pvkhdov5lgqclq.png" alt="Alt Text"&gt;
&lt;em&gt;The emojis really give the sections some character 😅&lt;/em&gt;
3.Important: Make sure that one of the sections is called 'Noise'&lt;/li&gt;
&lt;li&gt;Fill up those channels in 'Noise', which have a lot of messages coming in per hour (these are usually channels with bot(s)) and messages which are not that important.
5.Important: Collapse all your sections so that your sidebar looks really neat 🧹 ✨&lt;/li&gt;
&lt;li&gt;Now, expand the sections one-by-one and go through the unread channels. Collapse the section as soon as all the unread channels have been read.&lt;/li&gt;
&lt;li&gt;Voila!&lt;/li&gt;
&lt;li&gt;Go through the 'Noise' channel once every 2 hours or with a lesser frequency using the 'All unread' section. This allows you to skim through really quickly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Note: Do not forget to collapse the sections once you're done reading the channels within.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this works (for me):
&lt;/h2&gt;

&lt;p&gt;Seeing 6 sections, a subset of which is highlighted is much less daunting than seeing a multitude of highlighted channels.&lt;/p&gt;

&lt;p&gt;Additionally, the power of categorization lies within your hands, which allows you to group channels in terms of priority. For example, I have a section called 'Priority', and it becomes imperative that I check that section before anything else.&lt;/p&gt;

&lt;p&gt;Happy Inbox 0!&lt;/p&gt;

</description>
      <category>lifehacks</category>
      <category>slack</category>
      <category>productivity</category>
      <category>messaging</category>
    </item>
    <item>
      <title>Tracking your productivity - API First</title>
      <dc:creator>Anmol Shukla</dc:creator>
      <pubDate>Sat, 16 Nov 2019 07:21:16 +0000</pubDate>
      <link>https://dev.to/cazaimi/tracking-your-productivity-api-first-d3h</link>
      <guid>https://dev.to/cazaimi/tracking-your-productivity-api-first-d3h</guid>
      <description>&lt;p&gt;In a world full of feature requests, bi-weekly sprints and high iteration products, productivity is an important asset to have by your side. The idea is not to &lt;em&gt;spend more&lt;/em&gt; time, but to &lt;em&gt;do more&lt;/em&gt; in the time that you &lt;em&gt;end up&lt;/em&gt; spending and this is where productivity ends up being important. But let's take a step back and define productivity first:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Productivity (n.)&lt;/strong&gt;: the rate at which a person, company, or country does useful work&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That being said, like many aspects in our life, productivity too is cyclical, which means that an average person has both high and low periods of productivity throughout the day and that these periods occur roughly at the same times each day. This cyclical variation in productivity, with high and low periods is what constitutes, among many other biological phenomena, by the Ultradian Rhythm. &lt;/p&gt;

&lt;p&gt;Hence, one solution is to just get to riding these rhythms right!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is Ultradian rhythm?
&lt;/h2&gt;

&lt;p&gt;Ultradian Rhythm measures other physiological phenomena in human beings apart from productivity, but we will not discuss them here. The core idea, however is that of the physiological process being cyclical. You can know more about the Ultradian Rhythm &lt;a href="https://en.wikipedia.org/wiki/Ultradian_rhythm" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So if productivity is cyclical, and we cannot operate at peak productivity all the time, then the least we &lt;em&gt;can&lt;/em&gt; do is leverage the periods of the cycle with high productivity to our benefit, by performing intellectually/will power stimulating tasks, and leave menial tasks to the low productivity periods. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. How do you map it?
&lt;/h2&gt;

&lt;p&gt;I came across &lt;a href="https://evernote.com/blog/the-most-and-least-productive-hours-in-a-day/" rel="noopener noreferrer"&gt;this&lt;/a&gt; blog post by Evernote, which suggested recording three variables, on a scale of 1-10 every &lt;em&gt;working&lt;/em&gt; hour of the day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Focus&lt;/li&gt;
&lt;li&gt;Energy&lt;/li&gt;
&lt;li&gt;Enthusiasm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;over a period of 30 days or more to get an idea of your mental state throughout the day. The post suggested that one make note of these variables, and offered an Evernote note template to manage the recording process (Fun fact, that's how I signed up on Evernote).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhux184ulpzraa783zgyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhux184ulpzraa783zgyq.png" alt="Template offered by Evernote"&gt;&lt;/a&gt;&lt;/p&gt;
Ultradian Rhythm Template by Evernote



&lt;p&gt;However, I find spreadsheet updation absolutely disconcerting 🙅‍♂️. Combine that with my itch to work on &lt;a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" rel="noopener noreferrer"&gt;MVC frameworks&lt;/a&gt; other than &lt;a href="https://sailsjs.com/" rel="noopener noreferrer"&gt;Sails.js&lt;/a&gt;, and I decided that I will use a full fledged backend framework with a database to map this! The idea was to design an API which, by means of communication with the database, would store this productivity data. I could then create, read and manipulate the data using the API.&lt;/p&gt;

&lt;p&gt;Hence, I decided to use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="http://expressjs.com/" rel="noopener noreferrer"&gt;Express.js&lt;/a&gt; as the framework for the app&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.sqlite.org/index.html" rel="noopener noreferrer"&gt;SQLite&lt;/a&gt; as the database&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.getpostman.com" rel="noopener noreferrer"&gt;Postman&lt;/a&gt; as the API development tool&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, I know what you're thinking, "This is overkill", and you're absolutely right. It &lt;em&gt;is&lt;/em&gt; overkill, but this exercise helped me:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Learn how Express.js works&lt;/li&gt;
&lt;li&gt;Helped me track my productivity throughout the day&lt;/li&gt;
&lt;li&gt;Helped me to discover the benefits of API First.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Besides, the whole thing took me ~7-8 hours to get up and running, so win-win. 😇&lt;/p&gt;

&lt;p&gt;Also, I happen to use &lt;a href="https://www.getpostman.com/" rel="noopener noreferrer"&gt;Postman&lt;/a&gt; as an API management tool on a day to day basis (What good is your product if you, yourself don't use it 😉), and the data entry just became the simple task of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Opening the app&lt;/li&gt;
&lt;li&gt;Navigating to the collection &lt;/li&gt;
&lt;li&gt;Entering the numbers &lt;/li&gt;
&lt;li&gt;Sending a &lt;code&gt;HTTP POST&lt;/code&gt; request&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;which, by the way I'd prefer over navigating to a boring spreadsheet and entering numbers (Maybe that's just me). &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Although many people typically use Express as a MVC framework, my particular needs did not require me to use the "View" part of the MVC.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. API First and General architecture
&lt;/h2&gt;

&lt;p&gt;One line definition:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;API First design can be described as defining your API &lt;em&gt;before&lt;/em&gt; writing the first line of code. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;API First forces you to think from the perspective of its consumers rather than their own. At the end of any API is a consumer, which may either be an internal team, that consumes your team's API or the business' customers themselves, who integrate the API in their own workflows. &lt;/p&gt;

&lt;p&gt;Any API is meant to make the workflow of the consumer simpler. A well designed API makes it easier for the consumer to integrate the API into their workflow and thus, they can start realising the value that they get out of it right from the get go. Not only that, a well designed API makes it simpler for the user to manage their workflows if requirements change down the line.&lt;/p&gt;

&lt;p&gt;All of this translates to a better adoption rate for the API.&lt;/p&gt;

&lt;p&gt;Of course, API First has other benefits such as documentation, automated testing, etc. You can learn more about API first design &lt;a href="https://www.programmableweb.com/api-university/understanding-api-first-design" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Therefore, before I even typed down my first &lt;code&gt;module.exports = {}&lt;/code&gt;, I decided to design the API using Postman. I created a Postman Collection and began describing what the endpoints would look like. A Postman collection is essentially a group of requests (In this case, HTTP requests).&lt;/p&gt;

&lt;p&gt;The structure of these endpoints would depend on the structure which I choose to represent the data. Hence, I needed to define the data before I designed my endpoints. I realized that I required just &lt;em&gt;one&lt;/em&gt; data model: &lt;/p&gt;

&lt;pre&gt;The data about a given hour on a given date&lt;/pre&gt;

&lt;p&gt;Ex: The focus, energy and enthusiasm I felt at 1900 hours on July 22nd, 2019. So, each row of the table &lt;code&gt;HourData&lt;/code&gt; would contain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HourDataId (Primary Key)&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;Hour of the day&lt;/li&gt;
&lt;li&gt;Focus&lt;/li&gt;
&lt;li&gt;Energy&lt;/li&gt;
&lt;li&gt;Enthusiasm&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the DDL for those who are interested:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE hour_data (
    id         INTEGER PRIMARY KEY AUTOINCREMENT
                       NOT NULL,
    hour_id    INTEGER NOT NULL,
    date_id    INTEGER NOT NULL,
    focus      INTEGER DEFAULT 0,
    enthusiasm INTEGER DEFAULT 0,
    energy     INTEGER DEFAULT 0
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Designing the API then became simple: I required CRUD endpoints to read and modify this data, and the job would be done.&lt;/p&gt;

&lt;p&gt;I proceeded to create these endpoints and described them in a Postman Collection:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frqog5knnfmgz1307776v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frqog5knnfmgz1307776v.png" alt="Postman collection"&gt;&lt;/a&gt;&lt;/p&gt;
Postman Collection



&lt;p&gt;This design helped me in the long run, as it gave me a clear picture of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Exactly what this app would do&lt;/li&gt;
&lt;li&gt;What were the functional boundaries between app components&lt;/li&gt;
&lt;li&gt;What was to be the overall structure of the app&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Had I not gone with "API First", the app development would have taken a longer time with me going back and forth between design and code to figure out "Where should I put this?", "Should this code be a function of its own?", etc.&lt;/p&gt;

&lt;p&gt;Since Postman automatically generates the collection documentation for you, I did not have to write any code on my website to display it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can find the API documentation &lt;a href="https://documenter.getpostman.com/view/4520909/S1LvWoaC" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can find the code's repository on Github with the link mentioned at the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Actual tracking
&lt;/h2&gt;

&lt;p&gt;Since I used Git as the vcs for my code, after merging the code to &lt;code&gt;master&lt;/code&gt; and tagging &lt;code&gt;v0.1.0&lt;/code&gt;, I was ready to consume the API. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frqog5knnfmgz1307776v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frqog5knnfmgz1307776v.png" alt="Postman collection"&gt;&lt;/a&gt;&lt;/p&gt;
Postman Collection



&lt;p&gt;As mentioned before, all I'd need to do is: run the server, enter the focus, energy, enthusiasm values and hit the &lt;code&gt;POST Input data&lt;/code&gt; endpoint. The App would automatically pick up the date and time, and would store the data in the database. &lt;/p&gt;

&lt;p&gt;To remind myself about filling this every hour or so, I made a &lt;code&gt;crontab&lt;/code&gt; trigger a bash script.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crontab
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 7-21 * * 1-5 bash ~/circadian.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;“At minute 0 past every hour from 7 through 21 on every day-of-week from Monday through Friday.”&lt;/p&gt;

&lt;h3&gt;
  
  
  Bash script
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/Cazaimi/circadian-api/blob/master/circadian.sh" rel="noopener noreferrer"&gt;circadian.sh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This script runs an &lt;a href="https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html" rel="noopener noreferrer"&gt;Apple script&lt;/a&gt; internally which sounds a chime and speaks a reminder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Cazaimi/circadian-api/blob/master/notif.scpt" rel="noopener noreferrer"&gt;notif.scpt&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Results and Inferences
&lt;/h2&gt;

&lt;p&gt;I tracked this data for 50 days straight, by inputting the data as mentioned above. Post that, I used the &lt;code&gt;GET Retrieve all aggregates&lt;/code&gt; endpoint to retrieve average data by the hour.&lt;/p&gt;

&lt;p&gt;Some inferences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I am more productive towards the earlier parts of the day&lt;/li&gt;
&lt;li&gt;Energy tops at 9 am in the morning (Guess I am a morning lark 🌅)&lt;/li&gt;
&lt;li&gt;Energy is not at a high, post lunch 😳&lt;/li&gt;
&lt;li&gt;Enthusiasm peaks at about 4 pm&lt;/li&gt;
&lt;li&gt;I get absolutely knocked out after 8 pm 🥊&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Conclusion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Express is a light and flexible framework&lt;/li&gt;
&lt;li&gt;API first avoids re-design phases&lt;/li&gt;
&lt;li&gt;I should focus on intellectually taxing tasks in the morning and leave menial tasks towards the end of the day. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Psst, you can hit me up at &lt;a href="https://cazaimi.tech" rel="noopener noreferrer"&gt;https://cazaimi.tech&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you too share my hate for spreadsheets and love APIs, check out the repo: &lt;a href="https://github.com/Cazaimi/circadian-api" rel="noopener noreferrer"&gt;https://github.com/Cazaimi/circadian-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the awesome API development tool "Postman" at: &lt;a href="https://www.getpostman.com/" rel="noopener noreferrer"&gt;https://www.getpostman.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>productivity</category>
      <category>api</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
