Drupal behavoirs

Maybe you know about Drupal.behaviors, but if you just know this word, be aware to this article.

What is Drupal.behaviors?

Drupal.behaviors is an object inside the Javascript structure in Drupal, which allows us to attach functions to be executed at certain times during the execution time of the application.

Drupal core will…

Stacking Context

The stacking context is a CSS functionality that is often difficult to understand and one of the most misunderstood tool in CSS.

These terms that I’m going to explain may not be entirely clear. Things are always better understood by seeing them in action, that’s why I have created a…

Twig Filters and Functions

Twig is the template manager used by Symfony to add some logic to our variables in our templates. The functions and filters problem is that we have a limited number of them. So we are going to learn how to add new filters and functions.

But first… what are filters…

window location object

Window.location is an object to have information about the actual page. Also you can redirect or upload it.

First of all we need to know window.location properties:

For example, we have this URL: https://sararellano.medium.com/js-shorthands-3f675d4c3b13?filter=fronted#top

Debugging with Git Bisect

Today I’m going to write about Git Bisect. This is a very useful tool to find any specific error in our code.

What is Git Bisect?

Bisect means binary search algorithm and is an efficient way to search large groups of ordered data. It divides the data in half several times and applies a…

Defer vs Async

When your scripts are heavy and/or you have a slow server, they can affect the performance of your page. To help with this, we have 2 attributes that we can add to our scripts so that they don’t block or delay the execution of our website.

But first we have…

BEM it’s a very useful development methodology based on components. The base of this methodology is to divide the user interface into separate blocks to create scalable, flexible and reusable components. …

CSS Efficient

I have to be honest: I didn’t think about how efficient my CSS is. I focus more on trying to make my JS code more efficient so that the browser renders it as soon as possible, but I had never looked at my CSS. …

Debugging time

When I’m writing Javascript code, I put every 2 lines a “console.log”. But I have some problems because many times I can’t find a good answer. So I have investigated other forms to test my code and I found some interesting methods.

First of all, what is console.log?

“Console” is…


Shorthands (no matter what language we are working in) always help to make your code shorter, optimized and much cleaner. Here I want to recap some helpful shorthand coding techniques in Javascript that will surely help you a lot.

  1. Ternary operator

We can use “conditional ternary operator” instead of if…


Junior frontend developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store