Systems | Development | Analytics | API | Testing

AppSignal

Advanced Dependency Injection in Elixir with Rewire

In our last post, we explored how Dependency Injection (DI) is a powerful design pattern that can improve our ExUnit tests. In this article, we will dive deeper into the topic of DI in Elixir, focusing on the Rewire library for Elixir projects. We will cover Rewire's core concepts, how to get started with it, and practical examples. We will also see how to use Rewire alongside Mox. Let's get started!

How to Use Tailwind CSS for Your Ruby On Rails Project

It's hard to overstate the importance of Cascading Style Sheets (CSS) for all websites. Since the first CSS standards were published in late 1996, we have come quite far regarding features and ecosystems. Several frameworks have appeared and proved popular, one of the most recent being Tailwind CSS. In this post, we'll first examine Tailwind's utility-first approach before diving into how to use it in a Ruby on Rails application.

Develop a Serverless TypeScript API on AWS ECS with Fargate

AWS Fargate is a serverless compute engine that allows you to run containers without managing servers. With Fargate, you no longer have to provision clusters of virtual machines to run ECS containers: this is all done for you. Fargate has an Amazon ECS construct that can host an API. In this take, we will build a Fargate service using the AWS CDK, put the API in a docker image, and then host it inside Amazon ECS. The API will be a pizza API and we'll store the data in a DynamoDB table.

Cypress vs. Playwright for Node: A Head-to-Head Comparison

It's essential to test web applications to ensure reliability, functionality, and a good user experience. That's why robust testing frameworks have become so important for web developers. Among the plethora of available tools, Cypress and Playwright have emerged as two of the most popular choices for automating end-to-end testing. In this Cypress versus Playwright comparison guide, we'll explore the strengths and weaknesses of the two tools, their features, and their differences. Cypress or Playwright?

Five Things to Avoid in Ruby

As a contract software developer, I am exposed to oodles of Ruby code. Some code is readable, some obfuscated. Some code eschews whitespace, as if carriage returns were a scarce natural resource, while other code resembles a living room fashioned by Vincent Van Duysen. Code, like the people who author it, varies. Yet, it's ideal to minimize variation. Time and effort are best spent on novel problems.

Using Dependency Injection in Elixir

While controversial in functional programming, dependency injection can be a useful pattern in Elixir for managing dependencies and improving testability. In this, the first part of a two-part series, we will cover the basic concepts, core principles, and types of dependency injection. We'll explore its benefits in terms of modularity, testability, and maintainability. Then, we will look into a specific scenario where dependency injection can be beneficial, in this case, testing.

Understanding Offset and Cursor-Based Pagination in Node.js

Pagination means dividing a big chunk of data into smaller pages. It unlocks performance benefits for the backend, while also improving UX by sending manageable pieces of data to a client. In this article, we'll explore offset-based and cursor-based server-side pagination approaches, compare them, and implement cursor-based pagination in Node.js. Let's get started!

Creating Forms in Ruby on Rails with Simple Form

Ruby on Rails has changed how we build web applications. Early on, the framework came with some great features to help you get started and build robust applications. However, it can still be tricky to build and handle forms. Simple Form is a great option. Let's examine what Simple Form is, why we might need it, and some real use cases.

Effective Testing in JavaScript

Kernighan & Pike, The Practice of Programming, 1999 Despite constantly changing technologies and the needs of customers, some wisdom seems eternal. Programmers need to test their code. But thorough testing takes time. When we do it well, everything works, and a massive testing effort feels like a waste. However, when we do it badly, our code is often broken, and we wish that we had done better testing. I have some good news for you.

Debugging in Ruby with pry-byebug

For a software engineer, even the basic use of a debugger can save a lot of pain: adding breakpoints (places in the code the program will stop at and expose the current context) is very easy, and navigating from one breakpoint to another isn't difficult either. And with just that, you can say goodbye to a program's many puts and runs. Just add one or more breakpoints and run your program.