Jason Leow

Indie hacker, solopreneur | Creating a diverse portfolio of products + services.

Changed comments formatDatetime to numeric (instead of 2-digits, so that it doesnt show easily-misread times like 08:00pm when it should be 8:00pm)

Changed scrolltop button from & to πŸ‘† because the unicode showed an up-arrow emoji on mobile browsers

Added 1 new item to writing prompts

'What feels like play to you, but looks like work to others?'

Day 10 - Deep Year https://golifelog.com/posts/deep-year-1610266414444

Tried to fix scrollToTop config setting (for Nuxt) for home page, but not successful. Added a scroll-to-top button to make things slightly better as a temp measure

Nuxt.js site supposed to remember your scroll position is you set scrollToTop: false, but clicking back from a post page to home page brought me all the way to the bottom of the site. Weird thing is, this works on local but not production. Whhhyyyy? 😩

Revert comments thread back to asc order (oldest on top, to newest at bottom) because it's a conversation, not a news feed! Insight to user behaviour from chatting on Telegram group

Added timezone-based datetime to comments

Added timezone-based datetime to comments using Intl.DateTimeFormat(), so that users can better orient to the chronological flow of the conversation (like how we read the time stamps off our chat apps sometimes). Thanks to @Lobacrow for the insight!

formatDatetime: (dateStr, string) =>
Intl.DateTimeFormat('en-GB', {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: 'numeric',
hourCycle: 'h12',
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
}).format(new Date(dateStr)),

(Dev notes: This also sets me up to deal with the timezone-based streak calculation, one step fwd at a time)

Day 9 - Code only exists by the grace of others https://golifelog.com/posts/code-only-exists-by-the-grace-of-others-1610166733122

Day 8 - Fundamentals https://golifelog.com/posts/fundamentals-1610092536439

Fixed admin dashboard access issue on Heroku

Needed to add back APP_URL key and the .herokuapp.com url value to the config vars. Why did I change it in the first place??!!! 😑

Ref:
https://strapi.io/documentation/developer-docs/latest/concepts/configurations.html#available-options%20
https://forum.strapi.io/t/email-template-modification/694/9

Fixed background-image to be responsive on mobile

background-size: cover;
width: auto;
height: 100%;

Fixed mobile navbar not responding to click event by using Vue v-on, v-bind instead of vanilla js.

Followed this fiddle...Vue made it so much cleaner and less lines of code! - https://jsfiddle.net/tbonz/80jkq0Ls/

πŸŽ‰πŸŽ‰πŸŽ‰ YAAASSSS ITS FIXED!!!! After 3 days of debugging trial by fire, I fixed the post page loading issue. Woohoooo I wanna dance hahahahah! πŸ•Ί

Turned out, the culprit was a sort function for the comments v-for loop.

v-for="comment in sortedComments"
:key="comment"
>
...
computed: {
sortedComments() {
const x = this.post.comments
return x.sort(function (a, b) {
return a.id - b.id
})
},
}

Changed that function to using lodash's sortBy function and it works now!

import _ from 'lodash'
computed: {
sortedComments() {
return _.orderBy(this.post.comments, ['created_at'], ['desc'])
},
},

All thanks to @yuyu 's suggestion to comment out everything in _slug! That got me down the right path to debug this eventually! Note to self: always fall back to fundamentals when debugging - just comment out code first to isolate the bug. But the deeper mystery remains:

* why this worked before but not now
* the behaviour should be consistent on local and production, but it worked on local
* the function didn't crash the page if I entered the site via a different child page by directly typing in the url
* why lodash worked but a vanilla JS script didn't

Facing my HARDEST bug yet. Stayed up 4am the night before, tried fixing it the whole day today, but no luck

Day 7 - Chronotype metamorphosis complete https://golifelog.com/posts/chronotype-metamorphosis-complete-1609987348325

Day 6 - $5k MRR-Breaking it down https://golifelog.com/posts/dollar5k-mrr-breaking-it-down-1609908146149

To earn $5,000 monthly, I need:

50 people to pay $100/month
100 people to pay $50/month
200 people to pay $25/month
500 people to pay $10/month πŸ‘ˆ
1000 people to pay $5/month
5000 people to pay $1/month

Breaking it down in terms of actions:

$60k/year
… $5k/month
… $1250/week
… $166.66/day
… 10 people buy the $120 lifetime plan per week
… or 17 people sign up on the $10/m plan per day
… 1000-1700 views per day @ 1% conversion rate (assumed)

So my job now is to generate 1700 daily views ... πŸ€”

Researched about timezone management for apps

OK so this seems to be how the various packages should work on a high level:

* timezone detection - packages like jstz, moment.timezone.guess() to detect the tz of the user. These packages usually tap on the javascript Intl API
- Intl.DateTimeFormat.prototype.resolvedOptions()
* timezone library - a library of timezone offsets based on real world data (timezones are a mess, with daylight savings and all). This library would take the tz from the tx detection package, and pass on the offset needed calculate streaks
* streaks - calculate streaks data based on array of tz dates (I use date-streaks npm package)

Added feature/bug tags to roadmap

Learned something new today! I can actually v-bind a class attribute using the template literals `${ }`

:class="`is-${consideredFeature.typeColor}`"
Jason Leow Author

Thanks @yuyu! Great learning point, didn't know that! I just did what worked but this really helps. Must add this to future optim efforts

0 Likes
Yuyu

Probably not the best way if you intend to optimize it in the future: https://tailwindcss.com/docs/optimizing-for-production#removing-unused-css

0 Likes

Fixed Abe's streak manually

After some research and discussion with Abe, I think I know what went wrong with the streak mechanism. The npm `date streaks` package never calculated streaks based on timezones! Everything is in UTC +00 (as per recommended best practice of saving timestamps in databases). If users had very predictable routines of writing, it was still fine, but if someone wrote close to the end of their timezone windows, that might already be the next day in UTC time (thus broken streak). Need to look for a package that has a library of timezone offset rules to twin with my date streaks package, and perhaps another one too to detect user's timezone without user having to explicitly set it.

Day 5 - Biohacking sleep https://golifelog.com/posts/biohacking-sleep-1609833246396

Deployed roadmap page to

Felt like I made a mini-app within an app! Made this in 2 days - tabs for different upcoming features categories, with feature lists under each tab. Also added a few placeholders for upcoming features: upvote button, individual feature pages with comments threads for only logged in users.

Created component for roadmap page - tabs with a card/box-based list of features

Researched other feedback/roadmap tools, was either pricey (Canny.io) or didn't fit what I needed (Trello). So decided to make my own!

Created the roadmap page, since everyone is asking about it while giving feedback. 4 tabs - considering, planned, developing, launched. Each tab will have a list of features in card/box format, with future features like upvoting button, and comments thread upon click through to read/comment/discuss.
Jakub Dubec

@jasonleow Anyway its cool to have a writing streak, actually I am now on challenge to use paper diary for one month :D Thanks for inspirative update ;)

0 Likes
Jakub Dubec

Great! :-) Im curious what you will come up with soon. Leave me a note if you would like to localize it easily into more languages. We also have own tool for that :)

0 Likes

Day 4 - Why $5k MRR, not $1mil ARR? https://golifelog.com/posts/why-dollar5k-mrr-not-dollar1mil-arr-1609768815529

Fixed Keni's streak again. There's an issue alright, just that it's only affecting her, not the rest.How very odd.