Rails Parameters Parsing and the Case of Parameters Corruption

Rails is a developer-friendly web application framework that enables developers to do more with less code, but it isn’t always clear exactly what’s going on under the covers. One area where I’ve had a hard time was understanding how Rails parses the Request query parameters and the Form variables. So what's a query parameter? Query parameters are an optional set of key-value pairs that appear after the question mark in the URL. For example, name=contra is a query parameter in https://example.com/over/there?name=contra. And what's a form variable? When we submit a

Use case comparison between CSS Grid and Flexbox

Responsive design is a must-have in web design right now. And that can be easily achieved using CSS Grid or Flexbox. The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, making it easier to design web pages without having to use floats and positioning. The Flexible Box Layout Module, makes it easier to design flexible responsive layout structure without using float or positioning. In this article, we are going to look into the differences between CSS Grid and Flexbox. Are they a replacement for each other? Do they go hand in hand together? Can they

Ember Composable Helpers

In this article, we will look into what are Ember Composable Helpers and how are those useful but before that let's have a look at what are helpers in Ember.js What is a Helper?Helpers in Ember.js can be module or function that provides templates with the ability to have additional functionality. They help in formatting the data as required by the template. ExampleLet's consider an example: We have a list of arrays of movies as given below: /** This is an array of objects of movies **/ const movies=[ { name:"Joker", isSuccessful:true }, { name:"Titanic", isSuccessful:true }, { name:"The

How to resolve the issue with JW player that keeps playing audio despite switching to another player

Recently we have introduced a live streaming feature in our application. For that, we have used a JW player as it is easy to show youtube videos first and then streaming live events. We have also implemented a feature for an alternate player option for the end-user if there is any streaming issue. For that, we have used Flow player as it is lightweight and powerful. So we have JW Player as the default player and Flow player as an alternative. We have integrated the JW player library into our application from here and the flow player library from here.

Rate limiting using Redis in a Rails app

The web is a weird place. You go to sleep thinking that you have a perfectly functional web application and the next day when you wake up, you might find yourself staring at a sudden huge spike in the number of requests. Either your app got popular overnight or you were just a victim of a DOS attack trying to bring your app server down. Usually, it's the latter. There are some popular gems like rack-attack and rack-throttle which work quite well and provides a lot of flexibility. But if you're looking to write your custom logic with minimum dependencies,

How to add Elastic APM Support in Dotnet Framework

These days for every web application, there has always been the need to monitor application performance, but not always do it well. Similar is the case with the .NET application, but then we found Elastic APM, which is the best solution over this need. Here in this article, we will look at how to use Elastic APM in any .NET application. What is Elastic APM? Elastic APM is an application performance monitoring system. It's a real-time monitoring tool for applications. With Elastic APM, we can determine information on requests, responses, database queries, and external HTTP requests. Current version available for

Sync files to a remote location using rsync linux command and Ruby

Note: The entire approach highlighted in this blog about using the rsync command with Ruby is only applicable on Linux-based systems and won't be available on Windows. In this article, we will explore how to use rsync in Ruby to sync files from local to a remote location, how to improve its error logging and how rsync is better than scp. Let's first understand what is rsync: rsync is a Linux command to sync files from one location to another. We can run this command on the terminal and it will copy files from one directory to another, either locally

Everything you need to know about Serialization in Ruby on Rails: Part II

In the previous article of the Serialization in Ruby on Rails series, we became familiar with various serialization formats provided by the Ruby libraries. In this article, we will see how the YAML and JSON formats are used by Rails to store Ruby objects in a database. Serialization in Rails for Storage Rails framework allows complex objects to be stored in a database column via the ActiveRecord::Serialization module. But understanding when to store serialized data in a column is more crucial than knowing how to do it. Through this article, we will first learn "when" to store serialized data

ActiveRecord attribute encryption in Ruby on Rails for better security compliance

Data Encryption has never been so important to modern-day applications as it is today. Storing personal data in plain-text format makes the application open to data theft. Not only users' personal data is at risk, but even the application becomes subject to scrutiny when it falls under General Data Protection Regulation (GDPR) norms. In this blog post, we will explore a quick way to encrypt & decrypt model attributes using Rails handy ActiveSupport::MessageEncryptor class to ensure compliance such as GDPR. Let's start with some basics on PII and GDPR mandates. Personally Identifiable Information (PII) examples as per GDPR PII

Preferable Dependency Manager: Swift Package Manager(SPM) or CocoaPods

Recently, while using CocoaPods in my project, I realised the build time was taking longer. This led me to experiment with Swift Package Manager(SPM). So here I am sharing my findings with you based on these six criteria: 1.  Library Support: Even though both CocoaPods and SPM support Objective-C as well as Swift, CocoaPods has extensive support for varied types of libraries that help us in customising the project as per the user requirement. SPM is provided by lesser libraries resulting in fewer options to choose from. 2. Maturity: CocoaPods is a much stable and mature package manager than