ISO 8601 DURATIONS IN GO

This post is part of a series about chrono - an alternative Go module for working with dates and times. Problem If you’ve worked with the standard library’s time package before, you’ll know that the Duration type provides a way to describe a period of elapsed time, with nanosecond precision. Since Duration is just an int64, we can create a value and use the String function to format it to a string:

Read more

CROPPING VIDEOS ON LINUX

I recently had a need to crop a video that I’d shot landscape, but wanted to upload to Instagram as a reel. My original clip was 1280x720, but Instagram reels are 1080x1920, i.e. portrait. There are plenty of video editing suites that can do this, but I didn’t have any installed, and I knew exactly how I wanted to crop (so I didn’t need a preview). All I wanted to do was crop out the excess width (equally on the left and right), and maintain the original height.

Read more