Systems | Development | Analytics | API | Testing

A guide to custom model casts in Laravel

Model casts, mutators, and accessors are something you work with a lot when building Laravel applications. They play an essential role in how you interact with your models and their underlying data. Laravel ships with a variety of handy, built-in casts which cover the majority of your use cases. But there may be times when you need to create your own custom casts to handle storing and retrieving data in a specific way.

The ultimate guide to Python exception handling

Exceptions can occur for various reasons, such as invalid input, logical errors, file handling issues, network problems, or other exception conditions. Examples of exceptions in Python include ZeroDivisionError, TypeError, FileNotFoundError, and ValueError, among others. Exception handling in Python is a crucial aspect of writing robust and reliable code in Python.

Going deep on UUIDs and ULIDs

Not too long ago the Honeybadger team was debating between ULID vs UUID choice for primary keys. Ben, our dev-ops master, mentioned that he wished he'd used ULIDs instead of UUIDs for a particular system we built. Like any seasoned engineer in software development, my initial reaction was to mumble something non-committal and then sneak over to Google to try to figure out what the hell a ULID is. UUIDs are a bit more common, but I hadn't even heard of ULIDs.

Better stability with Rails load testing in Apache JMeter

Before we can release our software to end users, we must perform different kinds of tests to ensure that the application is bug-free and meets business requirements. When users begin using the application, various things can cause the application to behave unexpectedly, for some of the following reasons: For large-scale applications, these things are crucial to know before a full-fledged release.

How to use Solid Cache in Rails

The concept of caching is an important one in computer science and is directly relevant to building web apps. At a high level, caching takes advantage of the fact that memory lookups are faster and less compute-intensive than database queries. If you have a database query that might get made repeatedly, caching the result in a cache speeds up that flow of execution. Rails applications are no exception as they often use memory-based caches like Redis to cache data and improve application performance.

Using modules in JavaScript

Modules are one of the most commonly used JavaScript features because most JavaScript frameworks and libraries leverage the module feature for organization and componentization. Modules in JavaScript are probably underused—some developers even think that the import and export keywords are ReactJS features. In this article, we'll explain how to encapsulate code using the module system to make your projects cleaner. To start, let's take a look at what encapsulation is in the next section.

Understanding the insertion sort algorithm in Ruby

As we explore different methodologies for sorting data, we turn to the insertion sort algorithm. There are a number of reasons to like insertion sort! First, insertion sort is stable, which means that it does not change the relative order of elements with equal keys. It's also an in-place algorithm, meaning that it does not create a new array to store the sorted elements. Finally, insertion sort is a pretty simple algorithm to implement, as you'll soon see!

Handling spatial data in Django using PostGIS

As a Django developer, you might be tasked with a project that requires working with and manipulating spatial data. Spatial data refers to information that includes geographical or location-based attributes, representing the physical location and shape of objects on the Earth's surface or in three-dimensional space. Django provides a way to do that using PostGIS. PostGIS is an extension of PostgreSQL that adds support for spatial data.