Recently, I migrated a documentation page from Gatsby to Docusaurus. However, after I deployed a new version of the docs but I still see the cached version of the old docs. The reason is that the Gatsby version of the docs has a service worker that caches the artifacts. So, I need to remove the old service worker manually via Chrome Devtools.
Remove file or folder recursively
How to remove files and folders with a name pattern recursively?
Customize HTML in Jest
In some scenarios, you may want to customize the HTML in Jest to align with your actual app's HTML structure. You can do it by one of the following options:
How long files stay in temporary folder
How long files stay in temporary folder?
Usually 3 days if a file hasn't been accessed. It depends on OS.
Cannot run gpg No such file or directory
git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - error: cannot run gpg: No such file or directory error: gpg failed to sign the data fatal: failed to write commit object
Answer:
git config --global gpg.program "$(which gpg)"
Use pnpm with Gatsby
I recently migrated my Gatsby project from yarn to pnpm. So in this post I will go over quickly what needs to be done to get it working.
You can see the full PR that I migrate my project to pnpm here: https://github.com/nvh95/hung.dev/pull/62
Sharp error mac m1
When running command yarn
to install dependencies for a Gatsby project on Mac M1, I encounter this error with sharp
:
Convert to mp3 using ffmpeg
You can convert audio/ video files to mp3 format using ffmpeg by:
ffmpeg -i input.mov -c:v copy -c:a libmp3lame -q:a 4 output.mp3
This is handy when you trim the video/ audio when using QuickTime on macOS (since the extension will be .mov
or .m4a
)
Link to specific time in mp3 file via query string
You can link to any specific time in a mp3 file, just by adding a query string #t=<time>
to the mp3 file url.
For example, if you want to link to 18:15 of a mp3 file, 18*60 + 15 = 2295
, you can use the url https://cdn.changelog.com/uploads/jsparty/231/js-party-231.mp3#t=2295.
Reference: Jest Preview on JS Party Podcast
Error Application-specific password required
If you want to add an alias to send an email from a different email address. You might end up following this tutorial:
But you might encounter this issue: [AUTH] Application-specific password required.