development

Data Shortcode for Hugo

In the article, I show the differences in the website analytic metrics collected on the server- and client-side. It contains several dynamic values (e.g., pageviews or visits number, the date range, etc.) scattered throughout the text. To update them, I need to pass through the content and adjust them manually. So as I plan to bring the data in this post up to date regularly (I get new input every day), this task cumulatively could consume a lot of my time. Therefore, I have decided that the data in the post should be updated automatically. In this article, I describe how I have achieved this goal.

Pedantic Clippy

One of the reasons developers love Rust is its well-developed ecosystem. Clippy, a linter for the Rust code, is one of the main components in this ecosystem. It performs additional checks of the developed code reporting found issues and explaining how to fix them (and sometimes it even can fix them automatically). Its usage may be beneficial for Rust beginners and even professionals. In this article, I describe this tool and explain how to start using it.

Comparing Netlify and Cloudflare Pages

The core idea of the JAMstack architecture (JavaScript, API and Markup) is to substitute dynamic webpages with pre-rendered from a template static pages that use different services exposed through Javascript API to offer dynamic features. During the last several years, the JAMstack architecture has been becoming more and more popular especially due to the proliferation of serverless paradigm. This architecture also gains its interest among bloggers who appreciate full control over their websites. Seeing the rapid development of JAMstack, several companies have started offering services for this architecture: automated builds, build previews, CDN, caching, SSL certificate provisions, hosting. Using these platforms, it is now quite easy for developer-bloggers to launch a website. To my point of view, these platforms may take a piece of a pie from traditional blogging platforms.

For the last three years, I used Netlify to host my website. I was pretty happy with the services this company provides, especially considering that they were free of charge for me. However, recently Cloudflare has also launched its JAMstack platform called Cloudflare Pages, and I decided to try it myself in order to discover its pros and cons. In this article, I compare the services provided by these companies from a blogger perspective, and share my opinion when each of them should be used.

Closures in Rust

Today, I want to note down my thoughts on closures. Closures are important in Rust, because they are extensively used in iterator adapters paramount in development highly performant programs. However, to my point of view this topic is not well-covered in The Book. This may be a reason why it is considered among the most difficult parts of the language. In this post, I will try to shed more light on it, hopefully making it more clear to Rust learners. Note that I am still a novice to the language, and my understanding may not be fully correct.

Minimal Rust Binary Project

When you develop your first binary application using new language, the first issue that you face is how to organize your code so that you can easily extend it in the future. There is a good example in The Book on how to organize your code, parse and process command line arguments by yourself. However, in real world you would use a library to parse command line arguments, which most probably would be the clap library in case of Rust. In this article, I describe my template for creating a CLI (command line interface) application.

Outdated Pytest Version in Poetry

Problem

Recently, I have updated my operating system, and as a part of this process I have installed the latest poetry version (a tool for Python dependency management). When I have started a new project using my typical routine, I have discovered that poetry cannot install development dependencies exiting with a weird SolverProblemError error.

Starting New Python Project in VSCode

In the previous article, I have described how poetry can be used to configure Python workspace and to create a new Python package project. Although poetry creates the structure of a package and adds some boilerplate code, in order to develop this package in VSCode we need to do some additional configurations. In this post, I describe how to start developing a new Python package project in VSCode.