In the previous article, I talked about the different ways to load a ruby file and we’re not stopping there. Apparently, there’s an easier…
With Ruby, there are always multiple ways to accomplish a thing — loading files being one of them. In this article, I’ll be talking about…
Today, I learned about . If you’ve been a Ruby developer for quite some time, this block of code might look familiar to you. The above code…
One of the things I use to fix inconsistent tests is to use RSpec’s command. What it does is divide the whole test suite into smaller…
When I have multiple changes in one file and I plan to divide these into separate/multiple commits, I always rely on git’s patching…
Sometimes I get this issue when running certain commands in my terminal (on OSX) — and the only solution I find useful is running this…
Recently, I realized to write schema-only changes during migrations because it produces far less errors in the future. This means avoiding…
Maybe the easiest way is to start with an example: What’s wrong? Remember that calling in an ActiveRecord model is its own transaction…
Consider the following example and feel free to identify what the problem is. This block of code sure has a major issue that’s not as…
To get a clear understanding of this, let’s add an example that most of us can relate to — onboarding an employee . Example What happens…
There are three ways of storing sessions in your browser. Local Storage Session Storage Cookies In this article, I’ll try to explain their…
Today I learned an important thing on Rails migration. So apparently, each and every migrations are actually also ActiveRecord models. For…
Sometimes I find myself wanting to test a ruby code outside the context of Rails. If what I want to test is trivial and so simple, then…
It’s best practice to be as RESTful as possible with our controller actions. It makes it easy for developers to understand, extend, and…
Take a look at this feature test for a moment. One way of approaching this is using a page object. It looks something like this. Then you…
Using is easy. Let’s say for example after user creation, we want to send the user an email. Here’s one way we might approach this. Plain…
Given the class as shown below. The goal of this article is to let you know an alternate approach about constants and classes. If you are…
What’s a Vim Macro? A vim macro is simply a recorded series of commands. It can be used to effectively repeat complex commands quickly…
Sometimes I add multiple RSpec expectations in my tests. Here’s how it usually looks like. Running the test above will tell you that your…
Supports Rails v4.2 and up. This article will explain the installation process of tailwindcss in the context of building a new Rails app…
Binstubs are executable programs that act as a wrapper to their original executables. Let’s use for example. , by default, has an…
1. Update one gem at a time Doing a is not recommended because it will attempt to update all gems listed in your . Make sure you’re…
Today I want to share important things I learned about the . If working on a Rails project, commit to version control. If working on a…
If you have written some Ruby code for a while, this is probably how proper memoization looks like to you. Simple! But not 100% correct…
I wrote about my experiences while working remotely with Bloom. Check it out. https://medium.com/bloomx/my-reflections-on-working-remotely…
Procs and Lambdas are simply, blocks in ruby. The only difference between these and a simple block (which uses yield) is that the former can…
The year is coming to an end and I’m excited about it. What have you learned? Have you reached your goals? What are your plans for the…
With all the existing resources and tutorials surrounding React.js , it is pretty hard or rather overwhelming to start off. Unfortunately…
Today, I developed an app that uses @toddmotto ’s valuable API list. Good thing is he provided us with a JSON dump of all available API…
React comes together with a number of lifecycle methods. These methods are basically functions that gets called on a specific phase of a…
Building a component-based application is fairly reasonable. It can’t be that hard and at the same time, it can’t be that trivial…
Today I want to talk a bit about the Event Loop . If you want to get deeper with JavaScript, it is very essential to understand the…
I’ve been learning JavaScript for the past few days and I found a reasonable article about the important things we should know as a…
I decided to make this article for the purposes of actually learning the fundamentals of redux. Technically speaking, it is a container that…
Since the release of ES6, there has been a number of new and exciting features. One of those is the arrow function . In the surface, arrow…
Looking back during the last 10 years or so, mobile apps are nothing but a stranger of this world. Then suddenly, it boomed and went crazy…
Using fetch Using fetch, but with error checking The above code looks good but lacks an error checking mechanism. What if we provided a…
I came upon an article that has inspired me more to work better as a programmer and just in case you haven’t read it yet, kindly do so. It…
I used to love conditionals. I think everybody did. It gave us the ability to decide what the system should do depending on many factors. It…
Anonymous functions are simply functions or methods that is not assigned a name. While named functions are very much a common thing…
Hey there. How are you? It’s been a while since I last published an article! Well, that’s because I am currently involved in a JavaScript…
Hello again! So I decided to build a mock database server in Elixir without using GenServer . In the real world, this is probably something…
Concurrency and Parallelism are two of the most talked-about topics in computer science. The reason why is because these are very important…
It is very important to keep your controllers clean. It must be readable, concise and RESTful in a sense. With Rails, it is pretty easy to…
tl;dr - Just avoid them at all costs Callbacks are evil. Well, maybe at this point in time, you haven’t realized that yet but I want you to…
Looks like functional programming is gaining a lot of traction for quite some time now. I just started reading about Elixir and it seems…
Let’s show a list of products. This works fine. Until…there are thousands of records. So, let’s apply caching. With caching Now using…
As one of the developers on our team, writing efficient and well-written code is a serious responsibility. Our current setup assumes that…
Rubyists often write a block of code that is similar to the one below. This is a code smell. Here’s a better way to do it. The above example…
Ruby’s simplicity has reached a whole new level. It has given developers a new approach to writing code. For me, coding should be fun and…
I like Structs. They are simple and useful. They provide the same functionalities like classes do. I normally use a Struct if I only need to…