Navigating Self

My attempt to have a writing habit. Writing forces me to have clarity with how I'm living my life.

ComputersFinancesSystems and ProcessesThoughts

Category: Computers

I built Julie a Contract Maker

Every time Julie create contracts for her clients, she always complains. It’s one of the things she isn’t looking forward to do in her business. She have this Adobe Illustrator file she manually edits for every client. Even computation itself is manual work.

Her process looks like:

  1. Look for her laptop
  2. Look for laptop’s charger because it’s been a few days before she last used it 😄
  3. Open her Adobe Illustrator file
  4. Dig in client details. Is it in Facebook Messenger, Viber, email?
  5. Add client details
  6. Add payment terms
  7. Save to Dropbox
  8. Send to client for signing

All this takes her around 10-15 minutes per contract. At the end of it sumasakit daw ulo niya.

At one point I told her I make her a “contract maker” for her phone. She will only have to put in client details, then it will produce a PDF based on her AI template.

This video is our initial MVP (minimum viable product).

This removed half the steps of her current process. This also removed the need to have her laptop around to create contracts. Less friction to do as soon as her clients paid the down payment, with all the wedding details still fresh from their conversation. Computation and breakdown of payment terms are done automatically.

She tried it on an actual client who followed up her contract. It took her less than 5 minutes to do. Most of all, she doesn’t get headache doing it anymore. 🙂

Making a Personal Dashboard

I have been out of track for a while now. Julie is starting to get worried that I’m getting a little too present-oriented (YOLO lyf).

I think the problem starts when I stop checking in life metrics that directly correlates to my “sharpness”. Having no idea of how am I doing makes me care less of my performance. Resistance to know grows because I might not like what I find haha.

Somebody said that if you can’t track it, you can’t improve it.

What do I need to track?

I have 2 key performance indicator (KPI) that’s correlated with my work capacity and ability to plan about the future.

1. Screen Time – How much time I spend using a computer. This is tracked by running RescueTime that’s running in background of my computer all the time.

2. Intentional Work Time – How much time I spend intentionally working on something. “Intention” is the keyword. Regardless of how much I time I spend on a task, the important thing is if I am aiming at a clear end goal. Opposite of this is jumping from one distraction to the next without accomplishing anything concrete.

This is tracked by Toggl. The way it works is before I start using my computer, I have to put a short description of what I’m about to do and explicitly start Toggl’s timer.

Normally, I should have more or less 40 hours of screen time per week and around 20 hours of intentional work time. If I dip below 40 hours of screen time, it usually means I’m trying to avoid working by doing something else.

When I’m at my sharpest, I am more self-aware, this makes most of what I do to have clear intentions before I do them. The closer intentional work time to screen time, the better.

Out of sight, out of mind. The opposite is true too.

I need those 2 KPIs to be always in my sight. This will give me a general grasp of how I’m doing based on a concrete data. I can do my “getting back on track” checklist if I’m doing poorly.

I have the skillset to quickly whip up a simple dashboard that displays those data. I also have a spare tablet that I’m not using. I can use it to display my KPIs on 24/7 with very little power consumption (5V/1A).

Getting my hands dirty

1. Preps

I did not bother using any framework. It doesn’t matter how dirty the setup and the coding is since it’s personal use only. The goal is to display the correct data.

Originally I planned to use curl fetch the data but it looks like using API wrappers will be much faster and future-proof. I always went to the fastest solution because I want to have a working dashboard in one sitting.

I started 2 files: index.php for the gluing all the parts and composer.json for dependency management.

 

2. Getting RescueTime data

For RescueTime, I used borivojevic/rescuetime.

$rescuetime_key = "RESCUE_TIME_API_KEY";

use RescueTime\RequestQueryParameters as Params;
use RescueTime\Client;

$client = new Client($rescuetime_key);

$day = date('w');
$week_start = date('Y-m-d', strtotime('-'.$day.' days'));
$week_end = date('Y-m-d', strtotime('+'.(6-$day).' days'));

// Fetch activities for this week
$activities = $client->getActivities(
  new Params([
    'perspective' => 'interval',
    'resolution_time' => 'week',
    'restrict_begin' => new \DateTime($week_start),
    'restrict_end' => new \DateTime($week_end)
  ])
);
// Compute total time spent
$totalTimeSpent = 0;
foreach ($activities as $a) {
  $totalTimeSpent += $a->getTimeSpentSeconds();
}

$totalScreenTimeThisWeek = number_format(round($totalTimeSpent/60/60, 2), 2);

 

3. Getting Toggl data

For Toggl, I used ixudra/toggl.

$workspaceId = 0;
$apiToken = 'TOGGL_API_KEY';
$togglService = new \Ixudra\Toggl\TogglService( $workspaceId, $apiToken );

$response = $togglService->summaryThisWeek();

$totalIntentionalWorkThisWeek = number_format(round($response->total_grand/1000/60/60, 2), 2);

 

4. Displaying computed data to the page

<div>
    <p>Screen Time</p>
    <h1><?php echo $totalScreenTimeThisWeek; ?></h1>
</div>

<div>
    <p>Intentional Work</p>
    <h1><?php echo $totalIntentionalWorkThisWeek; ?></h1>
</div>

 

5. Keeping the data up-to-date

<!-- Refresh page every 10 minutes -->
<meta http-equiv="refresh" content="600" >

Putting everything together

I end up having a working dashboard in around 1.5h of intentional work. After the coding is done, I uploaded it to my server and load it in the tablet.

It sits on a shelve where I can see it everyday (together with The Daily Stoic, which I read 1 page everyday).

This sets a framework that I can update as needed if ever I need a new KPI to track. The process of adding a new data source will be just 1) figuring out how to get the data 2) displaying it. The boilerplate is done. The friction to update will be minimal.

If you are interested in this project, have a KPI to recommend, or just want to talk in general — feel free to reach out!

Getting better at vim will give me nothing. It will not get me closer to any goal I have now.

So this is my simple observation: When deciding to embrace a self-motivated ambition, choose a definition of success that your aunt in Peoria would understand and find impressive. This is not about succumbing to the status quo, but instead setting yourself up to receive the brutal but useful feedback needed to eventually start producing things too good to be ignored. – Pursue Metrics that Matter, Cal Newport

I’ve been thinking of making my workflow vim-centric again, just because.

Then this got me thinking:

Getting better at vim will give me nothing. It will not get me closer to any goal I have now.

PhpStorm works perfectly fine. It’s heavy, yeah. But so what? My machine can handle it pretty good.

Ewan ko ba bakit na attract ako sa idea na of “get better” at vim. It does not provide value. What I mean is, the effort I will put in it does not convert to something of valuable.

Pursue metrics that matter. Getting better at vim does not matter. Getting better at coding does. Better yet, getting better at achieving goals that improves my life is the thing that truly matters.

Focus on getting better at creating things instead.

Debugging

I enjoy understanding how other people code.

I’m not the type who bash at other programmers just because our “way” of thinking doesn’t align (most of the time).

Reading other’s people code and doing something about it is like stepping in someone else’s shoes. I asks all the why’s. Why did he do this, why did he do that. I try to think like the person who coded the thing.

Best practices are there for specific scenarios. There are no universal best practice. Early bird does not apply on going on a field of landmines.

The more “way” I know the better I get at choosing what’s the best for the situation.

This is why I’m getting paid by the premium. It’s because of the different “ways” I tried before and the lessons I learned from them and knowing which is the best for this specific situation.

Relaxed approach when coding

To conclude, programmers work at night because it doesn’t impose a time limit on when you have to stop working, which gives you a more relaxed approach, your brain doesn’t keep looking for distractions and a bright screen keeps you awake. — Maker’s Time

I code better when I’m relaxed. When there’s too much to think and worry about, I just can’t function properly. Most of my background processing are spent on worrying.

Note to self: have enough time to play around while coding. That way, you enjoy the actual work.

Create new Bitbucket repo on command line

My usual process when starting a new project in web development is to

  1. Create a new private repository at Bitbucket
  2. Add the remote url to my local repo
  3. Git push to remote

This involves a lot of context-switching by using a browser, remembering logins, clicking and copy-pasting stuff. It adds a lot of friction when starting a new project.

I decided to scratch my itch, make the process easier. I created a batch script that’s aliased to bitbucket command. It will ask my username, password, and a repo name. After that it creates it using Bitbucket REST APIs and adds the resulting repo to the remote of the current git repo.

It’s much simpler than it sounds haha. Here it is:

[gist id=6687a9676dedd47698a7]

Now I just need to type bitbucket and answer the prompt and the code will be ready to be pushed to it’s own repo. :)

2020 © Jerico Aragon