Jason Leow

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

Memory leak problems aside (wtf is `MaxListenersExceededWarning` ???), I think I got the `date-streaks` package to work....ish? I'm getting a response from my API client, but not the right response though. Node.js is just so haaaard....

Day 695 - Nutty November https://writelier.com/nutty-november-fcf5f977-c3ec-4e60-b83a-0ccfd8edca7d

Tried to install npm date-streaks but didn't work, and ended up getting warnings when restarting Strapi server `MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit` - this is too hard 😩😩😩

Day 694 - Opportune October wrap-up https://writelier.com/opportune-october-wrap-up-de05d90b-763c-40d6-b6dc-dadebf159a39

Switched my Strapi local db from sqlite to postgres, lost my local placeholder data but no biggie. Configuring databases always stresses me out...Hoping nothing goes wrong when I merge with master on HerokuπŸ€žπŸ˜…

Day 693 - Being selectively ignorant https://writelier.com/being-selectively-ignorant-0983a917-32cb-4e88-82a8-de84edb9f6da

πŸ”₯πŸ”₯πŸ”₯πŸ™ŒπŸ”₯πŸ”₯πŸ”₯ WOOHOO! FUCK YEAH!!! completed! My proudest streak ever! Day 692 - https://writelier.com/100-days-of-code-8a5b196b-a9b3-442d-bc0e-04e431438318

Managed to make raw sqlite db query in Strapi! Added a new streak route and a controller method using `strapi.connections.default.raw("SELECT author, strftime('%d-%m-%Y %H:%M:%f', published_at/1000.0, 'unixepoch') FROM posts ORDER BY author DESC");` Had to wrangle with epoch time (wut is this!?) vs unix timestamp! πŸ€ͺ Not completely there yet but at least now I can query the `author` and `published_at` dates and see the output on my api client. Next steps - install date-streaks package and integrate it to calculate streaks, figure out how to query in production db since its Postgres 😩

Dy 691 - Zoom is wonderful for introverts https://writelier.com/zoom-is-wonderful-for-introverts-7120182d-ef9e-4538-bf58-e5739e51070a

πŸ” Current mountain to overcome: how to calculate consecutive day streak in using either strapi.query or SQL query in postgres db. Read up on custom queries in Strapi docs, SQL query on calculating length of a series, MongoDB aggregate functions... brain overloadπŸ€ͺ

Day 690 - Nine criteria for deciding on whether to take on a project

Created my first test custom query on Strapi! OK seems simple enough... next: a custom query for production, for real

Jason Leow Author

@scriptifyjs I'm using Postgres for db instead, so I should look at this instead ? https://www.postgresql.org/docs/9.5/tutorial-agg.html

0 Likes

I've used to build Node.js REST and GQL for quite some time now, and Strapi offers a very good tradeoff between flexibility and out-of-the box functionalities, perfect for smaller projects. Only heard good things about Rails, never tried it myself, I grew up in the Node.js land 🍭

0 Likes

Day 689 - Entrepreneurship, a daily exercise in gratitude & impermanence https://writelier.com/entrepreneurship-a-daily-exercise-in-gratitude-and-impermanence-a5c57929-bb96-4b28-b106-fabfb90516a0

Added create is owner policy for posts, and changed users-permissions_user to author

Day 688 - Low tech, low competition businesses https://writelier.com/low-tech-low-competition-businesses-08415c2c-ea39-4eae-9e20-578171ac5aea

πŸ™Œ Solved it! Managed to create a new GET request by slug for my Strapi API, through help from the strapi forum. Apparently post/:id and post/:slug are identical routes, so I have to create post/slug/:slug instead. (Why is it identical? Still reading up more to find out, any resources welcomed)

Day 687 - A 5-step process for nearly anything https://writelier.com/a-5-step-process-for-nearly-anything-34de2b2c-643d-4551-bfc0-7854df708f13

Tried to add a new GET request to findOne by slug besides just findOne by id, but not working. Any Strapi/Node.js experts here? My questions is here: https://forum.strapi.io/t/problem-creating-a-new-get-request-to-findone-by-slug/669

Browsing and tinkering through Codepen for fun and CSS animations/micro-interactions is such a delightful thing, like this one is just magical, yet also practical https://codepen.io/aaroniker/pen/WNxoovJ So how come so few makers actually use micro-interactions in their products?

Created CNAME record for subdomain for English support site for Call Home

Day 686 - Choose your hard https://writelier.com/choose-your-hard-f160b447-9e93-4abf-8106-ddaed9765a22