Next Broadcast

Working on programming side-projects for the next 30 days straight

warpas Code and Eng DK30 Quarantine 2020 5 3

Description

I’ve been struggling to work consistently on side-projects for years and I want to build some better habits and break a few bad ones. I usually aimed too high (goals like “work on side-projects 3+ hours every day!”) and couldn’t sustain it for longer than two weeks at a time, and this time around I’m going for consistency with at least 1 small commit per day.

Link to the public repository I’m working on

Recent Updates

warpas 4 years ago

Day 30

I’ve started working on the function for copying all events between two calendars. It already fetches the specified list of calendars and gets all of their events. I need to make sure the formats match the code I wrote previously for adding events. If it doesn’t I’ll need to write some new code for that. We’ll see! That will happen later this week, but I won’t write another update here on it.

DK30 (Quarantine 2020 edition) is over for me! 🎉

I’m really glad to have participated! I started off thinking I’ll slowly get used to writing code every day. And that’s what happened. What I didn’t anticipate was the amount of code I’ll write on most of those days. And I didn’t skip a day, which is a surprise for me.

I’m writing these updates mostly for myself so there won’t be any sob stories about defeating adversity. I plan to continue working on this and other public projects in my Github repositories and maybe some open source code made by others (further down the road). There were 41 commits in this project when I joined DK30. I expected to get to at least 75 commits by the end. I’m ending at 95 commits today.

Thank you for the opportunity and I hope to join the next DK30 with a project that’s a bit more fun to follow for others ;)

warpas 4 years ago

Day 29

We’re closing in on day 30! Today I’ve swapped some Toggl configs to fetch workspace ID from Toggl instead of a config file. If I manage to resolve the base64 issue I ran into when I started the config will be minimal. I’d love for it to only require Toggl api_key. Alas, that’s beyond me for now.

Thank you for reading! 👋

warpas 4 years ago

Day 28

I’m rethinking use the use of values from RescueTime API. I’m not convinced they would be useful for me at this time. I think the better use of my time would be to just polish the current APIs and release it with better user experience. I’m not sure yet. I think I’m losing focus, which in turn discourages me from putting more time into the project. I need to plan ahead and re-focus. For now I just polished the default value for populating calendar to be in line with the most frequent use case.

Thank for reading 👋

warpas 4 years ago

Day 27

The challenge is drawing to a close. I’m happy to have joined! :) Today I continued playing around with RescueTime’s analytic data endpoint. I’ve build some hashes but still need to group them and join those responses. Maybe they even have it as an option somewhere if I dug a big deeper in the API.

Moving forward! Thanks for reading :)

warpas 4 years ago

Day 26

I’ve spent some time playing around with RescueTime’s analytic data endpoint. It looks much more useful to me in migrating events to my calendar than the daily summary. The results are unintelligible for now, but I will plan an interface for it. That’ll likely happen on Monday, because tomorrow’s going to be mostly a screen/computer-free day.

Enjoy your weekend! 👋

warpas 4 years ago

Day 25

I noticed that Fridays are usually the day of the week that my output takes the plunge compared to the rest of the week (that includes weekends). I don’t know why that is the case, but I’m curious and want to investigate that. Today’s update is boring - I’ve cleaned up some comments and “puts” statements. The code is a bit better than yesterday, but any real work will have to wait until tomorrow.

Have a great weekend! 👋

warpas 4 years ago

Day 24

Today I’ve played around with RescueTime response on the daily summary endpoint. There’s a lot of useful information there, but at the first glance I didn’t see anything that could help me organize it into neat events to put into my calendar. I’ll try different endpoints tomorrow. For now I’ve added a small report to my calendar with all of that data.

Thank you for reading! ❤️

warpas 4 years ago

Day 23

RescueTime API now responds with meaningful values! I made a typo inside the path in my request 😅 It’s fixed now. Short update today - I’ll dig into that API’s responses tomorrow.

Have a good day! 👋

warpas 4 years ago

Day 22

I had a choice today - tinker with my previously written code or jump to RescueTime API that I planned for this week. The fresh API ended up being more enticing to me. I bounced off of a bunch of 404 errors, but this is a good first step. I’m glad I started on it. It’s been a tough day.

I feel I took up a bit took much on lately. I’ll need some more structure and space to breathe. Python and ML course is taking its toll. In many ways it’s a good extension for this project. I don’t plan switching to it fully until 30 days are done. It’ll be a bit much, but I fully intend to work on both simultaneously.

Have a great rest of the day! 👋

warpas 4 years ago

Day 21

I’ve worked on a Python tutorial course today and poured most of my spare time into it. That’s why today’s update is rather small - I’ve updated the default values for weekly report generation to “last week”. That way in the vast majority of my use cases I won’t have to pass any parameters to that script and it’ll still do what I want it to 🎉

Thank you for keeping up! Have a great rest of the day ❤️

warpas 4 years ago

Day 20

Generating the weekly report got simplified. Before it needed the week start and end dates. Now just a single date is enough - the rest will be calculated automagically. It freed me to accept command line arguments just like in other scripts. Feel free to take a look!

Have a good day! 👋

warpas 4 years ago

Day 19

Moved creating weekly summary to a separate script file. Now the interfaces should be much more readable. The original script is now less than 35 lines of code. I think it’s nice and readable. Take a look and see if you agree or disagree :)

Have a great weekend! ❤️

warpas 4 years ago

Day 18

No new functionality today! I’ve spent the last hour cleaning up the code to (hopefully) be more readable. I’ve cleaned up most of the original script file. There are two overlapping responsibilities in that file (migrating data from a single day and generating a weekly report on Monday) and no way to access both of them without editing the source code. I don’t like that and so I cleaned up the first of those responsibilities. I’ll clean up the other one tomorrow. Then I’ll make it possible to switch between them either with command line parameters or just by accessing a separate file. Whichever is easier or more useful ;)

See you tomorrow! 👋

warpas 4 years ago

Day 17

In today’s update one functionality got changed. Calendar class has a copy_to_calendar method, which copies one calendar’s all events from one day to a different specified calendar. Previously it copied all of those events. Now it copies new events and skips duplicates. I think that part of the script got much more useful because a lot of the busywork got cut.

Thank you for keeping up! Talk to you tomorrow! 👋

warpas 4 years ago

Day 16

Today I’ve extracted handling command line inputs to a separate file/class. I also use it in another script now… Wait a minute.

I wrote most of these updates from the perspective of “I did something, read about me doing stuff”. I don’t think this type of narration is useful to anyone beyond me. I’d like to change that. From now on I’ll focus on writing for you, the reader. The paragraph above would sound a bit more like that:

The project got updated with a new class creatively called “CommandLine” for handling date inputs in params. Feel free to try it out with by adding a line like CommandLine.get_date_from_command_line(ARGV) much like in this commit. If you would like to use this script for your own calendars or Toggl timers then feel free to message me on Discord (@warpas) or on Github. Once the class was added to the populate_calendar.rb script, you can use call it from your command line with --date parameter with the following call:

ruby populate_calendar.rb --date=2020-05-13

Have a great day! ❤️

warpas 4 years ago

Day 15

I’m halfway through DK30! 🎉🎉🎉 Today I stayed in the spirit of improving the interface of the application. I’ve added to pass the date argument as a command line argument instead of fiddling with a specific line of code, that’s often commented out. It’s was a bit unwieldy to me. It was prohibitive to use for anyone else. I’m glad it’s done! I would love to improve that later and add more options. But frankly, this is an awesome jump in quality of use. And it’s a step to running it as a background process.

With that out of the way - I’d like to take a while to say that I’m really happy to have kept up the work every single day for the past two weeks. I hoped it wouldn’t be the case, but I had my doubts. I’m on track with the Goals specified on the right side, so I’ll throw some extra goals for Week 3 to keep the project engaging for me :)

Thank you for reading another post! ❤️

warpas 4 years ago

Day 14

The “no-duplicate” feature is working! It’s written horribly, but I’m going to leave cleaning it up for my future self. I’m glad it’s working today :) I’m also happy with the public interface. It’s usable, and the implementation details can be refactored relatively easily. Hopefully with a few tests written beforehand ;)

Please do remember to enjoy the rest of your day ❤️

warpas 4 years ago

Day 13

I’ve spent most of the day enjoying family time instead of programming. I’ve still managed to put in partial work on the “no-duplicate” feature for Google Calendar migration.

Have a good rest of the weekend! ❤️

warpas 4 years ago

Day 12

I’ve added two small commits today (commit1, commit2) mostly starting on adding events without duplicates. It gets annoying sometimes to test the script for days that already have been migrated, because a bunch of duplicate events get created. To make my life easier I’m working on avoiding to create those duplicates. It is going to be extremely inefficient at first, but the rule I want to follow for now is “early optimization is the root of all evil”.

I’ll keep chipping away at this thing over the next couple of days to make my life easier. Thank you for getting this far! 👋

warpas 4 years ago

Day 11

I’ve finished the function for sending data to Google Sheets. It actually works now! I’ve uploaded a simple presentation to Youtube. Hope that’s helpful!

Thank you for reading/viewing! 👋

warpas 4 years ago

Day 10

I tried something different to day - putting in the time into the side project before work instead of the evening. It was fun! I think I’ll do that again over the next couple of days ;) The order of the day was cleaning up the calendar interface. The code is much less messy in a couple of places. You’re welcome to take a look.

Thank you for reading! 👋

warpas 4 years ago

Day 9

I think it’s kind of an anniversary over here, isn’t it? ;) I’ve extended yesterday’s changes to Google Sheets class. Sitting down to coding was difficult today. It’s been a breeze to actually do it once I did. But I was on the verge of skipping a day. Glad I didn’t!

Thank you for reading! ❤️

warpas 4 years ago

Day 8

I moved Google authorization logic from Calendar specifics into a separate module/class. Later on I’ll reference it in Google Sheets class as well. It’s refreshing to finally get rid of chunks of code after I kept adding to this project ;)

Thank you for reading, have a great day! 👋

warpas 4 years ago

Day 7

I’ve extracted a big part of my script to a Calendar class method. This is my first step this week towards streamlining the calendar interface. I’ve taken a long, hard look at the coupling between Toggl and Calendar APIs I call in another script file. I’m not yet sure how to proceed on it. I’ll sleep on it and start working on decoupling the two tomorrow.

Frankly, I’ve spent a lof ot time procrastinating and talking to friends this evening. A reminder I set up on Thursday saved my daily contribution by saying “you want to go to bed in 30 minutes, remember?”. Glad I set that one up!

Thank you for reading! ❤️

warpas 4 years ago

Day 6

I’ve added a separate script to play with copying calendar entries from one Google Calendar to another. It works as well as I could have hoped for! That’s a quick and easy win that I’ve done in the morning, and it kept me going for a while longer. Shortly thereafter I’ve added a few more commits to play with Google Sheets API. It was mostly useful. The last 30 minutes were spend banging my head against the wall of sending stuff to a Google Sheet. I’ve made some progress, but I’ll have to wrestle with the API’s ValueRange to jump over that last hump and get a useful script out of it.

I know it’s the 6th day of my DK30 challenge, but it’s Sunday evening and I’m feeling pensive. I’m delighted to have found out and joined DK30! ❤️ The act of coming here today to write a short status update is enough of a kick for me to go above and beyond what I would have normally done. It feels a bit like sending messages in bottles into an ocean full of messages in bottles. But it’s useful for me even if nobody reads it. I’m happy to say there are 5 people who liked this project and 3 people who follow it. Thank you for your attention! 🙇‍♂️

Considering it’s a Sunday, I’m going to edit the Week 2 Goal with a short update to adjust the direction I want to go in. Adding Google Sheets to the project will make it a bit more taxing on my time to keep up the original scope, but I think it’s still manageable. I keep reminding myself though - it’s a marathon, not a sprint. I want to focus on consistently working on the project every day.

Thank you for reading! Have an amazing next week! 👋

warpas 4 years ago

Day 5

This weekend I had a bit more resolve than on a normal weekday. While playing around with configs and pasting events from one calendar to another I accidentally added a Google Sheets API integration ;) For now I’m able to pull data from any of my Sheets files and I’ve added it to configs in a similar way to calendars.

Turns out Google apps use the same set of credentials and much of the same authorization code. I’m glad I stumbled upon this integration because in my “config week” (see week goals the the right for Week 1) I’ll be able to extract the common parts of Google Calendar and Google Sheets auth to a separate module and streamline that part of configuration.

It was a good day! Thank you for reading and have a great day yourself! ❤️

warpas 4 years ago

Day 4

Another commit in the bag! I’ve added some “Getting started” steps and example files for configuration. I think it should be enough for people to run it themselves. I want to test it out over the weekend with a few people and check some responses, and adjust for that. To be honest though - this concludes what I wanted to get done this week. I’m happy with the results and I’m looking forward to start on the next week’s plans on Saturday :)

Thank you for reading! Have a great day! 👋

warpas 4 years ago

Day 3

I’ve added a basic version of a new feature to my Toggl exporter/Google Calendar importer. Now if a Toggl timer has a tag on it, the Calendar importer will try to add the event to the corresponding calendar instead of the default. The calendar list has to be specified in config for now, but I’m planning on expanding this feature in the next few days if it’s possible to get a list of calendars from the user account. Glad I could start this feature and have it working within an hour.

Thank you for reading and have an amazing day :)

warpas 4 years ago

Day 2

2 more commits added (first, second). Today I focused on streamlining Toggl config and I’ve added an example file for that. Now it’s just down to creating the same type of example file for Google Calendar API and writing a “Getting started” part of the Readme. That’s all I planned for this week. Looks like that’s within reach ;)

Thank you for reading. Do have a great day! 👋

warpas 4 years ago

Day 1

I’ve added a single commit with 20 minutes to spare before midnight in my time zone. It made meaningful strides towards this week’s goal of streamlining configuration. I’ll still need to clean it up a bit, but it appears to be working correctly.

Thank you for reading. Please do enjoy the rest of your day! ❤️

warpas 4 years ago

Introduction

I’m not starting from scratch - there are 41 commits in my project with the first one done on April 6. Ever since April 11 I managed to have at least 1 contribution to this project every single day. Then I heard about DK30 and I intend to keep it this pace up for the next 30 (+4) days and have at least 75 commits by the end of it.

With that out of the way, I’m off to get the first day’s coding in. Fingers crossed! 🤞

Estimated Timeframe

Apr 28th - May 31st

Week 1 Goal

I started with a small script in Ruby to create events in Google Calendar based on data from my Toggl timers. The app is at a useful, working state now. During the first week I’d like to clean up some configuration to make it usable to people who are not me. Currently the configuration is scattered among many different files. I’d like to make one file (secret, outside of the repository) with an “example” file and an instruction on how to get it up and running. Feel free to monitor the progress in the public project repository.

Week 2 Goal

Let me reiterate - the goal is consistency. Working bit by bit on the project every day. I don’t want any big plans or expectations that I want to hit of what exactly the milestones are. With that said, I’d like to spend the second week to streamline the interface for the Google Calendar class to decouple my script from the implementation details of that class.

📝 EDIT: I’ve added Google Sheets API to the project during the first week. I’m still going to focus on streamlining the Calendar interface this week, but I’m also going to extract the pieces of configuration common between both of the Google APIs this script uses. I’m also making it a point of pride for me to add a script for pulling some useful data from Toggl and/or Calendar and saving it inside a specified Google Sheets file. It should be enough until Day 14 of the project! Fingers crossed 🤞

Week 3 Goal

I’d like to spend the third week on clearing the interface for the Toggl class to decouple my script form it. I would also like to add two tests per every public function. Which will hopefully encourage me to make as few public functions as possible ;) Again, consistency is the goal, not specific features.

📝 EDIT: I didn’t add the “point of pride” from last week. It was supposed to be “a script for pulling some useful data from Toggl and/or Calendar and saving it inside a specified Google Sheets file”. Turns out I don’t have a use case like that. I didn’t want to invent one out of thin air. It sounded to me like a perfect way to get discouraged on the project.

I’ve made a script like that for my wife but I won’t commit it to a public repository without making the data anonymous. I’ll do that this week. On top of the “cleanup Toggl interface and add tests” goal from third week I feel I’ll have enough work for this week. But I’m sure I’ll add something on top of that as I go along to keep the project interesting to me :)

Week 4 Goal

By the end of the project I’d like to add RescueTime API wrapper to it as well. I’d like to represent data from it in my Google Calendar. The main use case I’m interested in is creating an event for how much time I spend on Youtube every day. I’m not yet sure it’s possible with their given API, but I’ll try my best.

By the end of May I’d love my Github contribution graph to be nothing but green squares from April 11 to May 31 :)

Tags

  • coding
  • ruby
  • api
  • toggl
  • google calendar
  • github
  • google sheets