Page 5

24

I’m 24 now.

I recognise that I compare 2021 and 2020 a lot. There were a lot of profound moments last year that can be broken up into specific themes - each with their own priorities and concerns. And it’s interesting to think how, though the day and month is exactly the same, changing 1 number in the year can result in different themes. It seems like opposite ends of a coin. This goes to show how time is relative. On one hand, a year can be short. On the other, especially due to all the up’s and down’s 2020 brought in both societal and personal life, it can be long.

For example, this time last year, I didn’t celebrate my birthday. I was in a transition period where I failed to invest in my social circles, and a lot of friendships languished. Now, I have various close groups of friends.

Being 24 also feels weird. For me, 22 and 23 are the more awkward years, because they follow 21, an age number glorified thanks to the permeation of US culture. I guess I never imagined being 24. I can imagine myself at any other number in the 20’s, but just not 24. Maybe it’s because, when I just started in my 20’s, I knew a lot of people who were 24. So possibly it feels surreal to reach the same age as my ‘mentor’ peers.

That’s enough reminiscing about the past. What about the future?

Honestly, I’m looking forward to it. Over the past year, I’ve become more and more comfortable with myself. I think that my personality has a number of dual aspects, and I’m becoming comfortable in reconciling the two, rather than rejecting one for another. As a result, I recognise there’s a lot of things I want to (and can) achieve, or at least experience.

However, at the same time, I do recognise that I need to be more patient with myself. Success is more guaranteed and maintained when there’s consistent practice behind the effort. If success was like a skyrise building, then it can only get taller when the foundation is solid. Otherwise, it’ll collapse on itself.


So, Brian, enjoy every moment and be grateful. It took you a while to get here. It took a lot of self-doubt, time and effort. It cost you a bit too - there were moments where you got hurt, sometimes unnecessarily due to your ignorance and naivety. Yet, all these experiences helped to mould who you are right now, so be grateful. The craziest part to all of this is that you’ve just started, it’s not even the finish line. So there’ll continue to be moments where you are uncomfortable or get hurt. But, Brian, you’re a human, not a leaf that gets blown around by the wind. You get to be in control, so you can decide how to interpret the events that get thrown at you.

You’re 24 now.

post

An Update

I haven’t written anything in a while, but that doesn’t mean I’ve been neglecting my blog. Rather, I’ve been thinking a lot about what to write, which has resulted in nothing being published. How ironic, the desire to do more has resulted in doing nothing at all.

Life has also been busy, which is a convenient excuse for not writing. But it’s also the truth. Life has been fast-paced, which is exciting but also somewhat nerve wracking. So many things have happened in the past few weeks that I’m worried that I’ll burn out. So now I’m trying to stabilise more, such as by writing more or investing in more introverted activities.

As I said, I’ve been brainstorming some longform topics, so if the next update takes a while, it’s because I’m cooking something exciting.

Stay tuned.

post

Excel to Calendar Script

One of the motivations for writing a blog was to post scripts and write about them, much like Dr Drang.

Today, I have one such opportunity.

I’m recently starting a course and the admin gave the timetable in an excel spreadsheet. Each sheet represents a weekday. This is kind of uncomfortable to read and I assumed that I would have to add it to my calendar anyways at some point or other. Well, I’ve been learning AppleScript over the past few weeks, so what better way then to show off what I’ve learnt!

Here’s the code in its all glory:


set last_cell to ""
set start_range to ""
set end_range to ""
set d to ""

tell application "Numbers"
	set hi to table 1 of active sheet of front document
	set ho to cell range of hi
	repeat with r in rows of ho
		set row_num to address of r as number
		if row_num > 2 and row_num mod 2 is 1 then
			repeat with C in cells of r
				set current_cell to formatted value of C as text
				if name of column of C is "B" then 
					set d to word 1 of current_cell & space & word 2 of current_cell
					if word 2 of current_cell is "Jan" then
						set d to d & " 2022"
					else
						set d to d & " 2021"
					end if
					set d to AppleScript's date d
				else if name of column of C > "B" and name of column of C  "U" and current_cell is not "missing value" then
					if last_cell is current_cell then
						set end_range to name of column of C as text
					else
						if start_range is not "" then
							set s_d to (value of cell 1 of column start_range of hi) as text
							set e_d to (value of cell 1 of column end_range of hi) as text
							
							if e_d is not "Date" and e_d is not "Week" then
								
								set s_d to word 1 of s_d as number
								if s_d is 12 or (s_d  1 and s_d  5) then
									set s_d to date ((s_d as text) & ":00PM") of d
								else if s_d  8 and s_d  11 then
									set s_d to date ((s_d as text) & ":00AM") of d
								end if
								
								if (count of words of e_d) is 3 then
									log e_d & " has 3 items"
									set e_d to date (word 2 of e_d & ":00" & word 3 of e_d) of d
								else if (count of words of e_d) is 4 then
									log e_d & " has 3 items"
									set e_d to date (word 3 of e_d & ":00PM") of d
								else if (count of words of e_d) is 2 then
									log e_d & " has 3 items"
									set e_d to item 1 of word 2 of e_d as number
									if e_d is 12 or (e_d  1 and e_d  5) then
										set e_d to date ((e_d as text) & ":00PM") of d
									else if e_d  8 and e_d  11 then
										set e_d to date ((e_d as text) & ":00AM") of d
									end if
								end if
								
								set summary to last_cell & space & s_d & "-" & e_d & " /School"
								tell application "Calendar"
									set dds to make new event at end of events of calendar "School" with properties {summary:last_cell, start date:s_d, end date:e_d}
								end tell
							end if
						end if
						set start_range to name of column of C as text
						set end_range to start_range
					end if
					set last_cell to current_cell
				end if
			end repeat
		end if
	end repeat
end tell

I’m not going to lie, it’s an ugly piece of shit. I could have tidied it by writing functions, but I felt stubborn about writing everything in one module. This may have been my downfall.

One of the reasons why the code is so convoluted is because I had to account for a lot of random logic in the spreadsheet. The visual presentation may look nice, but it was very difficult to parse. Each calendar event was actually 2 cells merged together, so I had to ensure that the same event was added to my calendar twice. Additionally, I realised that the other sheets had a 8-6pm day compared to a 8-5pm day, so the code that checked the range of calendar events had to be modified (another weird thing: the calendar events were prefixed and suffixed with the date and calendar weeks? so checking those boundaries was something I had to check).

The hardest part was converting the data from 1 type to another. I ran into a syntax error because I tried to convert a string into a date object, but because I was working within a tell statement, I had to prepend the Applescript's keyword so that Applescript didn’t get confused with the date command supplied by Numbers.

One last hurdle was that I tried to take a shortcut by using Fantastical and its natural language parser so I didn’t have to do too much data wrangling. But the parser was very finicky so I had to feed everything into Calender anyways.

I might revisit this post and write more about my challenges, as well as create a more elegant solution in the future. I know I’ll have to look at the code again because the timetable will be updated again in June for the second half of the year. But I’m glad it’s working so far, and my calendar is looking very busy.

Ship

Over the weekend, I made something fun. I shared it with some friends. But I was more proud of the fact that I was able to ship something very quickly. I haven’t worked on a side project in a long time and I haven’t shipped anything in a much longer time, so being able to end the dry streak was a personal win. Things that helped along the way were:

  1. reducing the feature list to keep things very basic
  2. having prior experience on launching a website (this blog!!!)
  3. using netlify to quickly upload and build the website

Another thing that really helped me was picking Svelte as my Javascript framework. I’ve never used it before, but I’ve seen it been recommeneded quite a lot. It was really helpful to use their online examples REPL to flesh out the prototype. Because rather than having the mental overhead of “omagerd I’m making something”, I could relax and just think that I was experimenting with something. So approaching the task with a playful mindset also aided in shipping the webapp.

I would like to work on more things in the future, and by recording this mindset, I can always come back and remember how shipping is not so bad after all.

post

OmniFocus to Things

I made my first blog in 2013 on LiveJournal. Nothing really happened after that, apart from the time my friend introduced me to tumblr. So it’s now 2021, and I’m taking my first steps to having a blog on my own domain. Pretty exciting stuff.

After approximately an year and half using OmniFocus as my todo manager, I’m switching back to Things temporarily. While OmniFocus is a lot more powerful and its outlining ability allows for good organisation of hierarchical information, I’ve been frustrated by its iOS interface. There’s too much tapping to navigate everywhere. It’s come to the point where I don’t like using OmniFocus to check tasks or add new ones while I’m on the move. I want to use my task manager as more of a 2nd brain, and the friction and inertia embedded in the interface is making me rely more on memory rather than delegating that cognitive load.

I’ve used Things for the last couple of days and I’ve been enjoying it. Though Things has a lot more simplicity, the user interface is well thought out and makes it easy to navigate and create projects and tasks. One thing I realised was that each task can act as an atomic note, so I’ve been enjoying adding Zettelkasten-like notes to different areas of focus. I’ve been experimenting this style with lecture notes and annotations for several books that I’m reading.

I plan on returning to OmniFocus but I think I need some time to reflect on my workflow before returning back to it. I’ve previously used Kourosh Dini’s “Creating Flow” workflow with OmniFocus but I’ve found that you need to be very diligent because a lot of the “flow” relies on manual task creation. However, I subconsciouly resist this workflow because my nerdy brain thinks that I’d rather automate that process, but I never end up doing it. Hence, that part of the workflow never develops.

post

It's Alive!

I made my first blog in 2013 on LiveJournal. Nothing really happened after that, apart from the time my friend introduced me to tumblr. So it’s now 2021, and I’m taking my first steps to having a blog on my own domain. Pretty exciting stuff.