I manage the build process for Android applications. Part of the process automatically updates the version of the application in various build.gradle files. In a Jenkinsfile, a list of file paths are passed into a for-loop in which the find-and-replace sed command is run to set the new version number.
Sed for Find-and-Replace Sed is a library used for performing all sorts of text operations, which makes it very handy for scripting related work....
To count the number of increases in depth, this function iterates over the given input and checks to see if the previous number was smaller than the current one. If so, the counter gets incremented. At the end, the value of the counter is printed which refers to the total number of times that the depth measurement increased.
def day1(): input_file = open("day1/day1-input") lines = input_file.readlines() counter = 0 for index, line in enumerate(lines): if index !...
After a few attempts, I have automated the process for optimizing images for JamilGhar. As my wife adds images to the project’s git repository, a bash script that runs on regular intervals will compress them. The end result is fantastic because she no longer has to wait on me to manually optimize them for her and the Raspberry Pi that sits under my desk is being very useful.
Why is optimizing images important?...
Search is an important functionality for any content heavy website. Our decision to use a static site for our recipe blog meant that adding complex features that involve server operations would be difficult to implement without relying on third-party tools. These features include comments and custom metric tracking.
Luckily, this problem has been solved by a Javascript library called Lunr.js. Lunr provides a fast search experience for the user by processing JSON documents produced by static site generators like Hugo....
At my work we use Personal Access Tokens (PATs) to authenticate to a GitHub repository (as opposed to using a password). I was having trouble cloning the repository and seeing the following error
After browsing Stack Overflow posts, I realized that I didn’t set the right “scopes” or permissions for my token. I generated a new token but this time I made sure to set all the scopes under “repo”....