<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Yet Another Boring Developer's Blog</title><link>https://mauricius.dev/</link><description>Recent content on Yet Another Boring Developer's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 23 Aug 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://mauricius.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Building a Modern Web App without feeling the JavaScript Fatigue</title><link>https://mauricius.dev/building-a-modern-web-app-without-feeling-the-javascript-fatigue/</link><pubDate>Sat, 23 Aug 2025 00:00:00 +0000</pubDate><guid>https://mauricius.dev/building-a-modern-web-app-without-feeling-the-javascript-fatigue/</guid><description>Introduction Let’s be honest for a moment: the current state of the Front End web development ecosystem is deeply broken. I&amp;rsquo;m not the first one to say this; it&amp;rsquo;s a conversation that has been going on for at least a decade now.
The so-called JavaScript fatigue is real1. Too many frameworks, too many tools (linters, transpilers, bundlers), too many concepts (code splitting, tree shaking), and too many obscure errors (Hydration failed seriously?</description></item><item><title>Basic guide on how to use restic for local backups</title><link>https://mauricius.dev/basic-guide-on-how-to-use-restic-for-local-backups/</link><pubDate>Thu, 17 Aug 2023 00:00:00 +0000</pubDate><guid>https://mauricius.dev/basic-guide-on-how-to-use-restic-for-local-backups/</guid><description>Introduction Even though most of my data (mostly code and a few personal documents) is already in online repositories, cloud services or external hard drives, I still think that having a backup that can be quickly restored is important.
However I&amp;rsquo;ve always had a difficult relationship with backups tools. They were either hard to use, too slow or cluttered with unnecessary functions therefore I&amp;rsquo;ve never found a backup program that fully clicked for me.</description></item><item><title>The subtleties of ElasticSearch synonyms</title><link>https://mauricius.dev/the-subtleties-of-elasticsearch-synonyms/</link><pubDate>Fri, 14 Apr 2023 00:00:00 +0000</pubDate><guid>https://mauricius.dev/the-subtleties-of-elasticsearch-synonyms/</guid><description>Introduction The synonyms feature in ElasticSearch is very powerful, but just like most of the ElasticSearch features, it hides complexities and subtleties that might be hard to understand at a first glance.
Synonyms bridge the gap between relating concepts and ideas (i.e. &amp;ldquo;England&amp;rdquo;, &amp;ldquo;UK&amp;rdquo;) or between slightly different vocabulary usage (like British English &amp;ldquo;colour&amp;rdquo; vs. American English &amp;ldquo;color&amp;rdquo;) in the documents and queries, which cannot be implemented using token filters like stemmers or fuzzy queries.</description></item><item><title>Inject global data in Next.js during build time</title><link>https://mauricius.dev/inject-global-data-in-next.js-during-build-time/</link><pubDate>Sun, 22 May 2022 00:00:00 +0000</pubDate><guid>https://mauricius.dev/inject-global-data-in-next.js-during-build-time/</guid><description>Introduction At work we started to use Next.js for a new project. So far the experience has been nothing but positive, however recently we hit one of the limitations of the framework. We wanted to inject data, fetched from an API, in all the pages during build time. Specifically we wanted to fetch Feature Flags from our dedicated service into Next.js, in order to conditionally render new features.
You would think that this requirement would be easily covered by Next.</description></item><item><title>Generate a temporary presigned upload URL using Laravel Storage class</title><link>https://mauricius.dev/generate-a-temporary-presigned-upload-url-using-laravel-storage-class/</link><pubDate>Sat, 29 Jan 2022 00:00:00 +0000</pubDate><guid>https://mauricius.dev/generate-a-temporary-presigned-upload-url-using-laravel-storage-class/</guid><description>Introduction By default, all objects in an S3 bucket are private, meaning only the bucket account owner initially has access to the objects. However, the object owner can optionally share objects with others by creating a presigned URL, using their own security credentials, to grant time-limited permission to download the objects. This is particularly useful because it means that you don&amp;rsquo;t have to provide bucket access to other users and restrict their access with IAM policies.</description></item><item><title>Deploy a scheduled workload on Fargate using AWS CDK</title><link>https://mauricius.dev/deploy-a-scheduled-workload-on-fargate-using-aws-cdk/</link><pubDate>Sun, 28 Nov 2021 00:00:00 +0000</pubDate><guid>https://mauricius.dev/deploy-a-scheduled-workload-on-fargate-using-aws-cdk/</guid><description>Introduction What is CDK If you already know what CDK is, feel free to skip this section.
The AWS Cloud Development Kit (CDK in short) is a relatively new framework for defining cloud Infrastructure as Code (IaC).
CDK offers a high-level object-oriented abstraction to define AWS resources imperatively using the power of modern programming languages. CDK addresses the same type of problems that tools like Terraform or CloudFormation aim to solve.</description></item><item><title>Elixir deployments optimized for free hosting</title><link>https://mauricius.dev/elixir-deployments-optimized-for-free-hosting/</link><pubDate>Sat, 03 Apr 2021 00:00:00 +0000</pubDate><guid>https://mauricius.dev/elixir-deployments-optimized-for-free-hosting/</guid><description>Introduction Recently I stumbled upon this excellent article by Damon Janis about how to deploy a Phoenix web app to a single Linux server, optimizing for cost effectiveness, control, and simplicity.
If you haven&amp;rsquo;t already, then you should read it immediately. It contains a ton of useful information, not only Elixir-related.
In this post I want to integrate the previous article with the approach that I used during the deployment of one of my latest Elixir side-projects.</description></item><item><title>How to use Fastify on Google Cloud Functions</title><link>https://mauricius.dev/how-to-use-fastify-on-google-cloud-functions/</link><pubDate>Tue, 05 Jan 2021 00:00:00 +0000</pubDate><guid>https://mauricius.dev/how-to-use-fastify-on-google-cloud-functions/</guid><description>Introduction This post started as a simple guide on how to configure the Fastify web framework to run inside a Google Cloud Function, but its focus quickly switched to a deeper analysis on the authentication to Google Cloud Functions (GCF from now on).
GCF is the FaaS (Function as a Service) platform provided by Google. It&amp;rsquo;s a serverless execution environment for building and connecting cloud services. With Cloud Functions you write simple, single-purpose functions that are attached to events emitted from your cloud infrastructure and services.</description></item><item><title>Use context in ExUnit tests</title><link>https://mauricius.dev/use-context-in-exunit-tests/</link><pubDate>Sun, 03 Jan 2021 00:00:00 +0000</pubDate><guid>https://mauricius.dev/use-context-in-exunit-tests/</guid><description>Introduction I&amp;rsquo;m on my journey to learn the Elixir programming language and I&amp;rsquo;m really enjoying the process so far.
Elixir is a dynamic, functional language designed for building scalable and maintainable applications.
Switching from a Object-Oriented approach to a functional approach makes me appreciate the benefits of immutable data and function composability.
I decided to document my progress in my blog, specifically I would like to write about any non-trivial issue that I encounter during this learning path.</description></item><item><title>Run and debug Github actions locally</title><link>https://mauricius.dev/run-and-debug-github-actions-locally/</link><pubDate>Sat, 17 Oct 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/run-and-debug-github-actions-locally/</guid><description>Introduction The GitHub actions service was launched exactly one year ago (November 2019).
Since then it has got lots of positive feedback and it has quickly convinced many developers to shift the integration and deployment pipelines of their applications from external CI/CD services to GitHub. Having the possibility to build, test and deploy code from a central service greatly helps developers, who are notoriously lazy (or at least, I am 😔).</description></item><item><title>Reduce the size of a large MySQL dump file</title><link>https://mauricius.dev/reduce-the-size-of-a-large-mysql-dump-file/</link><pubDate>Sat, 12 Sep 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/reduce-the-size-of-a-large-mysql-dump-file/</guid><description>Introduction I already mentioned in a previous post that sometimes at work we have to deal with very large mysqldump backups of our production MySQL databases. A couple of days ago I had to restore locally a database from a 2.6 GB dump file gzipped, which means that the full database was almost 27 GB large.
Running the import command
$ mysql -u homestead -psecret mydatabase &amp;lt; large-dump.sql completely killed my MySQL development instance (I&amp;rsquo;m using Laravel Homestead), forcing me to recreate the virtual machine entirely from scratch.</description></item><item><title>Send email in Laravel without using Mailables</title><link>https://mauricius.dev/send-email-in-laravel-without-using-mailables/</link><pubDate>Fri, 21 Aug 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/send-email-in-laravel-without-using-mailables/</guid><description>Introduction I keep forgetting how to send an email in Laravel without using Mailables. The the documentation does not help so I&amp;rsquo;m writing this down here for future reference.
The following examples are based on the code of the Mailer class
How to In order to send a raw message (in plain text) you can use the raw method of the Mail facade:
&amp;lt;?php Mail::raw(&amp;#39;Hello, welcome to Laravel!&amp;#39;, function ($message) { $message -&amp;gt;to(.</description></item><item><title>Implement dynamic custom messages from validation errors in Laravel</title><link>https://mauricius.dev/implement-dynamic-custom-messages-from-validation-errors-in-laravel/</link><pubDate>Thu, 30 Apr 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/implement-dynamic-custom-messages-from-validation-errors-in-laravel/</guid><description>Notice: the following article takes into consideration Laravel versions lower than 5.5. After that it is easier to use custom validation rules
Introduction Laravel provides different approaches to validate your application&amp;rsquo;s incoming data.
My favorite method to validate input data in controllers is to create Form Requests: custom request classes that contain authorization and validation logic. They allow you to keep your controllers as clean as possible, because the logic is executed before hitting them.</description></item><item><title>Remove Laravel Mix during tests</title><link>https://mauricius.dev/remove-laravel-mix-during-tests/</link><pubDate>Sat, 18 Apr 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/remove-laravel-mix-during-tests/</guid><description>Introduction Laravel Mix is a handy Webpack wrapper for frontend asset building pipelines. It definitely helps any Laravel developer which wants to avoid the pain of Webpack setup and configuration.
For example, the following 2 lines:
mix.js(&amp;#39;resources/js/app.js&amp;#39;, &amp;#39;public/js&amp;#39;) .sass(&amp;#39;resources/sass/app.scss&amp;#39;, &amp;#39;public/css&amp;#39;); will apply
module bundling, minification, and concatenation using the app.js JavaScript file as entry point, writing the output in public/js sass compilation of the app.scss file into public/css Then in your Blade templates you can use the global mix helper to get the URL of the versioned asset from the mix-manifest.</description></item><item><title>Parse log files with AWK</title><link>https://mauricius.dev/parse-log-files-with-awk/</link><pubDate>Wed, 08 Apr 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/parse-log-files-with-awk/</guid><description>Introduction Not everyone can afford (or have the need of) an ELK stack for analyzing logs. Sometimes reading files from the command line is the fastest and most straightforward way to spot a problem, if you know how to filter the data.
AWK is an excellent UNIX tool (actually it&amp;rsquo;s an interpreted programming language) for processing structured data, for example rows and columns generated by applications and tools.
The word AWK comes from the initials of the language&amp;rsquo;s three developers: Alfred Aho, Peter Weinberger and Brian Kerningham, that presented their work in the 1977.</description></item><item><title>Testing approaches for Laravel Form Requests</title><link>https://mauricius.dev/testing-approaches-for-laravel-form-requests/</link><pubDate>Sat, 18 Jan 2020 00:00:00 +0000</pubDate><guid>https://mauricius.dev/testing-approaches-for-laravel-form-requests/</guid><description>Introduction Laravel Form Requests in my opinion are one of the most powerful components of the framework. They can handle request authorization and validation ahead of controllers, keeping them more clean and concise. They have been an important part of the framework since version 5.0 and dispite a few minor differences between versions, they have not really changed much.
In this post we are going to briefly introduce them, for the few of you who are not familiar with the topic, and then I will try to cover the strategies that you can apply to test them.</description></item><item><title>Extract a single table from a full MySQL dump file</title><link>https://mauricius.dev/extract-a-single-table-from-a-full-mysql-dump-file/</link><pubDate>Tue, 31 Dec 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/extract-a-single-table-from-a-full-mysql-dump-file/</guid><description>Introduction At work we have to deal with very large mysqldump backups of our production MySQL databases (sometimes they can be over 10 GBs large). From time to time we have to restore single tables in our local development environment. Importing the entire database is out of question because this operation can take up to 40 minutes to complete. Manually editing the SQL dump is also impossible because opening such large files will likely kill any text editor.</description></item><item><title>Test Laravel job delayed in Queue</title><link>https://mauricius.dev/test-laravel-job-delayed-in-queue/</link><pubDate>Thu, 26 Dec 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/test-laravel-job-delayed-in-queue/</guid><description>Quick Tip Since version 5.0, Laravel provides the possibility to delay the execution of a job later in time. You can accomplish this using the later method of the Queue facade:
&amp;lt;?php $date = Carbon::now()-&amp;gt;addMinutes(15); Queue::later($date, new SendEmail($message)); Alternatively you may use the delay method when dispatching a job:
&amp;lt;?php ProcessPodcast::dispatch($podcast) -&amp;gt;delay(Carbon::now()-&amp;gt;addMinutes(15)); You can use a class that implements the DateTimeInterface interface or an instance of DateInterval class to specify the delay (Carbon helps a lot when dealing with dates).</description></item><item><title>Release Laravel jobs in queue without increasing attempts</title><link>https://mauricius.dev/release-laravel-jobs-in-queue-without-increasing-attempts/</link><pubDate>Sun, 13 Oct 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/release-laravel-jobs-in-queue-without-increasing-attempts/</guid><description>Introduction I&amp;rsquo;m currently working on a platform for processing videoclips. Our job is to extract as much information as possible (e.g. detect tags, detect faces, get dominant colors, etc.) out of each clip. Most of the heavy lifting is delegated to 3rd-party services, such as AWS Rekognition and Google Video Intelligence, which can provide the most &amp;ldquo;reliable&amp;rdquo; and cheap Machine Learning platform for this kind of tasks.
Without going too much into details, target videoclips are selected on the platform and submitted to a pipeline.</description></item><item><title>Building a pagination component in Svelte</title><link>https://mauricius.dev/building-a-pagination-component-in-svelte/</link><pubDate>Sun, 28 Jul 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/building-a-pagination-component-in-svelte/</guid><description>Introduction - What is Svelte? Svelte is a (not so) new framework for building User Interfaces. It borrows some ideas from its more popular peers, like React and Vue.js, but it brings its own ideas into the mix, in order to maximize efficiency and performances.
Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.</description></item><item><title>Require a local Composer package for development</title><link>https://mauricius.dev/require-a-local-composer-package-for-development/</link><pubDate>Fri, 12 Jul 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/require-a-local-composer-package-for-development/</guid><description>Introduction In PHP world Composer is currently the industry standard handling third-party packages. It allows us to automatically download the code libraries from Packagist along with all of their dependencies.
When developing a package that is going to be used in a framework, say Laravel for example, you don&amp;rsquo;t want to constantly push changes and require the package in a &amp;ldquo;real&amp;rdquo; project to test the integration. Wouldn&amp;rsquo;t be nice to include the local version of the package and test it straight away, as if it was just pulled from Packagist?</description></item><item><title>Unit test Laravel pre-5.3 Queue facade</title><link>https://mauricius.dev/unit-test-laravel-pre-5.3-queue-facade/</link><pubDate>Fri, 07 Jun 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/unit-test-laravel-pre-5.3-queue-facade/</guid><description>Introduction This post is a followup of the previous one.
During my daily job I often work with old (pre 5.3) Laravel versions which do not provide fake implementations on facades, since this functionality has been introduced in version 5.3. For example with the Queue facade you can make the following assertions:
&amp;lt;?php // Fake Queue functionality Queue::fake(); // Perform order shipping... Queue::assertPushed(ShipOrder::class, function ($job) use ($order) { return $job-&amp;gt;order-&amp;gt;id === $order-&amp;gt;id; }); // Assert a job was pushed to a given queue.</description></item><item><title>Unit test Laravel pre-5.3 Mail facade</title><link>https://mauricius.dev/unit-test-laravel-pre-5.3-mail-facade/</link><pubDate>Mon, 27 May 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/unit-test-laravel-pre-5.3-mail-facade/</guid><description>Introduction This post is only serving as a reference to how the Mail facade should be unit tested in Laravel versions previous to 5.3.
When testing an application we don&amp;rsquo;t want to send actual emails to users. We just want to fake them so we can ensure that they are getting sent, at some point, to the right users and with the right content.
Laravel provides Mail Fakes since version 5.</description></item><item><title>Use import aliases in Rollup module bundler</title><link>https://mauricius.dev/use-import-aliases-in-rollup-module-bundler/</link><pubDate>Tue, 07 May 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/use-import-aliases-in-rollup-module-bundler/</guid><description>Introduction Sometimes, when working with JavaScript and module bundlers, it&amp;rsquo;s useful to create aliases in order to import or require some modules more easily. In Webpack for example you can use the resolve.alias directive inside the configuration file.
module.exports = { //... resolve: { alias: { &amp;#39;applicationRoot&amp;#39;: path.resolve(__dirname, &amp;#39;src/&amp;#39;) } } }; A common use case for aliases is to abstract the application root, so instead of using relative paths when importing like so:</description></item><item><title>Effective pagination in AdonisJS</title><link>https://mauricius.dev/effective-pagination-in-adonisjs/</link><pubDate>Sun, 07 Apr 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/effective-pagination-in-adonisjs/</guid><description>Introduction Notice: I already did an introduction on AdonisJs, a Laravel-inspired web framework for NodeJS. You can read that post first if you don&amp;rsquo;t know what AdonisJS is.
In the latest months I tried to get more comfortable with AdonisJS by building a concrete side-project. My impressions so far have been really positive, even though the work required to achieve some basic functionalities is higher and less intuitive compared to the effort required in Laravel.</description></item><item><title>How to use presenters in AdonisJs Edge templating engine</title><link>https://mauricius.dev/how-to-use-presenters-in-adonisjs-edge-templating-engine/</link><pubDate>Sat, 26 Jan 2019 00:00:00 +0000</pubDate><guid>https://mauricius.dev/how-to-use-presenters-in-adonisjs-edge-templating-engine/</guid><description>Introduction Being a very passionate Laravel fan, I decided to step up and finally try properly AdonisJs. I already tried some small bits of it a couple of years ago, but the generator syntax did not really appeal to me. Finally with async/await we have a battle-tested MVC framework (the current version is 4.1) with modern syntax that brings Rails/Laravel concepts to NodeJs.
The value proposition of the framework is the same that fuels modern MVC frameworks: reduce the time required to be productive, by providing an opinionated structure to get you up and running quickly, without the hassle of installing and configuring different packages.</description></item><item><title>Configure an infrared remote control with Linux</title><link>https://mauricius.dev/configure-an-infrared-remote-control-with-linux/</link><pubDate>Thu, 27 Dec 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/configure-an-infrared-remote-control-with-linux/</guid><description>Introduction Recently I bought a shiny new Intel NUC8i7HNK, equipped with 16 GB of RAM and a 500 GB SSD and I installed Ubuntu 18.04 LTS. I have to say that it works smoothly and my overall experience with it is really positive this far. I don&amp;rsquo;t really miss the MAC or Windows at all.
The Intel NUC8i7HNK comes with many different expansion options and among these, there is a front consumer infrared (CIR) sensor, so I asked myself if it was possible to control the NUC with a standard TV remote control.</description></item><item><title>Get the full path of a File using the Storage facade on Laravel</title><link>https://mauricius.dev/get-the-full-path-of-a-file-using-the-storage-facade-on-laravel/</link><pubDate>Mon, 22 Oct 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/get-the-full-path-of-a-file-using-the-storage-facade-on-laravel/</guid><description>Introduction This post is just a reference for the various ways of retrieving the full path of a file using the Storage facade in Laravel.
Under the hood the Storage facade it uses the Flysystem PHP Package by Frank de Jonge, allowing the developer to use the same API with different filesystem drivers (Local, SFTP, Amazon S3, Rackspace and so on).
In this post I&amp;rsquo;m interested in getting the full path of a file.</description></item><item><title>Nullable objects using JavaScript proxies</title><link>https://mauricius.dev/nullable-objects-using-javascript-proxies/</link><pubDate>Sun, 07 Oct 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/nullable-objects-using-javascript-proxies/</guid><description>Introduction JavaScript proxies are an ES6 (aka ES2015) feature that lets you wrap an existing object and intercept any access to its attributes or methods, even if they do not exist.
var proxy = new Proxy({ name: &amp;#34;John Doe&amp;#34; }, { get: function(target, property) { if (property in target) { return target[property]; } else { return &amp;#34;Nope!&amp;#34;; } } }); console.log(proxy.age); // &amp;#34;Nope!&amp;#34; console.log(proxy.name); // &amp;#34;John Doe&amp;#34; console.log(proxy.title); // &amp;#34;Nope!</description></item><item><title>Handling breadcrumbs with VueX in a VueJS Single Page Application</title><link>https://mauricius.dev/handling-breadcrumbs-with-vuex-in-a-vuejs-single-page-application/</link><pubDate>Sat, 06 Oct 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/handling-breadcrumbs-with-vuex-in-a-vuejs-single-page-application/</guid><description>Introduction At work we are building a complex Single Page Application with VueJS, VueX and VueRouter. As soon as it started to get bigger we found the need to add breadcrumbs to the main interface, in order to indicate to the user exactly where he/she is and to provide an effective navigation mechanism.
At first we searched for existing solutions and libraries, however we only found bits of inspiration, but nothing really ready to use, so we decided to roll out our own solution for the purpose.</description></item><item><title>Manage content in a ProcessWire website using Telegram</title><link>https://mauricius.dev/manage-content-in-a-processwire-website-using-telegram/</link><pubDate>Tue, 14 Aug 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/manage-content-in-a-processwire-website-using-telegram/</guid><description>Introduction In this tutorial we will learn how to manage content in a ProcessWire website using a Telegram bot.
Today responsive bots are on everyone&amp;rsquo;s mouth, so I decided to take a deep dive into this new (at least for me) world to learn something new, but also to build something useful using my favourite CMS.
Notice: If you don&amp;rsquo;t where to start with ProcessWire, I suggest you to look at my 4-part series &amp;ldquo;How to build a basic webiste with ProcessWire&amp;rdquo;.</description></item><item><title>Remove duplicate rows from MySQL table</title><link>https://mauricius.dev/remove-duplicate-rows-from-mysql-table/</link><pubDate>Sat, 14 Jul 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/remove-duplicate-rows-from-mysql-table/</guid><description>Introduction Suppose that we have a MySQL table with the following fields:
SHOW COLUMNS FROM survey_responses; --------------------------------------------------------------------------------------------------------- | id (PK) | survey_id (FK) | page_id (FK) | question_id (FK) | option_id (FK) | session_id (FK) | value | --------------------------------------------------------------------------------------------------------- You don&amp;rsquo;t need a lot of context, you just need to know thtat this table is used in a survey application, where users can create their surveys and submit them to other users.</description></item><item><title>Use language-aware cache helper in Laravel</title><link>https://mauricius.dev/use-language-aware-cache-helper-in-laravel/</link><pubDate>Sat, 14 Jul 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/use-language-aware-cache-helper-in-laravel/</guid><description>Introduction This little trick comes from the frustration of forgetting the language code in the cache key, inside the Cache helper of Laravel.
Suppose that in a multilingual blog you are visiting the home page for the first time, using the default language (e.g. English). If the website caches the posts to speed up the response, maybe using the following code
&amp;lt;?php $posts = Cache::rememberForever(&amp;#39;posts&amp;#39;, function() { return DB::table(&amp;#39;posts&amp;#39;)-&amp;gt;where(&amp;#39;lang&amp;#39;, app()-&amp;gt;getLocale())-&amp;gt;get(); }); if you visit the same website using a different language you will get the English version of the posts, because they are stored in cache with the same key (posts).</description></item><item><title>Laravel catch-all route for Vue Single Page Applications</title><link>https://mauricius.dev/laravel-catch-all-route-for-vue-single-page-applications/</link><pubDate>Fri, 06 Jul 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/laravel-catch-all-route-for-vue-single-page-applications/</guid><description>Introduction Building a complex VueJS SPA implies a lot more challenges than an ordinary application. At my job we are creating a VueJS powered SAAS platform, which shows us how powerful this library is, but also how easy it is to misunderstand things.
The Problem This application is built upon a set of APIs provided by Laravel. We also have a few routes with static regular pages. Our RouteServiceProvider.php looks like the following:</description></item><item><title>Building a basic reserved area with ProcessWire</title><link>https://mauricius.dev/building-a-basic-reserved-area-with-processwire/</link><pubDate>Sun, 08 Apr 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/building-a-basic-reserved-area-with-processwire/</guid><description>Introduction In this tutorial we will learn how to add a simple reserved area to an existing ProcessWire website, using two handy modules, an external package and a few tricks.
In short we will build a protected page on our site, where users of a specific role can log in using their credentials, see a list of documents that the administrator made available to them, and download each one using a secure link.</description></item><item><title>Practical use case for React.js High Order components</title><link>https://mauricius.dev/practical-use-case-for-react.js-high-order-components/</link><pubDate>Sat, 03 Mar 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/practical-use-case-for-react.js-high-order-components/</guid><description>Introduction Since the React core team dropped the support for mixins, which were the standard way of sharing code between components, the use of composition over inheritance has become the right way for building user interfaces.
A High Order Component (HOC from now on) is a pattern for reusing component logic that has evolved to maturity. It&amp;rsquo;s used throughout many famous libraries like Redux or React-Router, and it&amp;rsquo;s a direct consequence of React&amp;rsquo;s compositional nature.</description></item><item><title>Split char-separated values in MySQL</title><link>https://mauricius.dev/split-char-separated-values-in-mysql/</link><pubDate>Sat, 10 Feb 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/split-char-separated-values-in-mysql/</guid><description>Introduction Recently I needed to extract a list of URLs from a MySQL table. All those URLs were inserted in a single TEXT column, however they were all separated by semicolons. The situation was more or less like the following:
SELECT * FROM links --------------------------------------------------------------- | id | urls | --------------------------------------------------------------- | 1 | http://first.link;http://second.link | | 2 | https://third.link | | 3 | | | 4 | http://fourth.link;http://fifth.link;https://sixth.link| | .</description></item><item><title>Feature Flags in ProcessWire</title><link>https://mauricius.dev/feature-flags-in-processwire/</link><pubDate>Sat, 06 Jan 2018 00:00:00 +0000</pubDate><guid>https://mauricius.dev/feature-flags-in-processwire/</guid><description>Introduction While building a website or an application, it&amp;rsquo;s often useful to control which parts are visibile (and which are not) to the actual users. Maybe you just want to hide a particular functionality on which you are still working, or maybe you just want to reveal things gradually without deploying new code in production. This concept is called Feature flags or Feature toggles.
Feature Flag is a technique to turn some functionality of your application off, via configuration, without deploying new code.</description></item><item><title>Using ProcessWire InputFieldDateTime via API</title><link>https://mauricius.dev/using-processwire-inputfielddatetime-via-api/</link><pubDate>Sat, 09 Dec 2017 00:00:00 +0000</pubDate><guid>https://mauricius.dev/using-processwire-inputfielddatetime-via-api/</guid><description>Introduction Recently I had the need to create a custom form in the backend, using the API and InputField modules that ProcessWire provides. Think InputFields as the basic building blocks to create forms in ProcessWire. They are used all over the administration panel, and provide styling (via jQuery UI), validation ad error rendering (through the FormBuilder) out of the box.
Here is an example of how you can use the API to create a basic form.</description></item><item><title>Conditional validation on Laravel's Form Request</title><link>https://mauricius.dev/conditional-validation-on-laravels-form-request/</link><pubDate>Thu, 10 Aug 2017 00:00:00 +0000</pubDate><guid>https://mauricius.dev/conditional-validation-on-laravels-form-request/</guid><description>Introduction In my opinion, Laravel Form Requests are one of the most useful components of Laravel. They can perform authorization and validation on requests, without even touching the controller.
Form Requests are also very flexible, because they are completely customizable by method overriding.
When creating a Form Request, the first method to implement is the authorization() method, which can be used to check if the authenticated user can perform the action.</description></item><item><title>Confirm form submission without loops using jQuery</title><link>https://mauricius.dev/confirm-form-submission-without-loops-using-jquery/</link><pubDate>Sat, 10 Jun 2017 00:00:00 +0000</pubDate><guid>https://mauricius.dev/confirm-form-submission-without-loops-using-jquery/</guid><description>Introduction This post falls in the category &amp;ldquo;Short tricks that I would teach to my younger self&amp;rdquo;.
Let&amp;rsquo;s assume that you want to display a confirmation dialog before submitting an important form. You can leverage the Window.confirm() method, which displays a modal dialog with two buttons, Ok and cancel.
Window.confirm() returns true if the user clicks on the Ok button.
&amp;lt;form onsubmit=&amp;#34;return confirm(&amp;#39;Do you really want to submit the form?</description></item><item><title>Check for foreign key existence in migrations</title><link>https://mauricius.dev/check-for-foreign-key-existence-in-migrations/</link><pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate><guid>https://mauricius.dev/check-for-foreign-key-existence-in-migrations/</guid><description>Laravel provides a couple of handy features to check for the existence of a table or column using the hasTable and hasColumn methods:
&amp;lt;?php if (Schema::hasTable(&amp;#39;users&amp;#39;)) { // } if (Schema::hasColumn(&amp;#39;users&amp;#39;, &amp;#39;email&amp;#39;)) { // } However, sometimes you need to check the existence of foreign keys or indexes on tables, for example when you need to rename columns, in order to avoid annoying errors. Unfortunately Laravel doesn&amp;rsquo;t provide such methods out of the box, but you can easily leverage the doctrine/dbal library in order to get the current state of columns.</description></item><item><title>Integrate the Facebook SDK in a React Native application</title><link>https://mauricius.dev/integrate-the-facebook-sdk-in-a-react-native-application/</link><pubDate>Fri, 09 Dec 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/integrate-the-facebook-sdk-in-a-react-native-application/</guid><description>Introduction React Native FBSDK is a wrapper around the iOS and Android Facebook SDK which allows for Facebook integration in React Native apps. It allows to access to native components, from login to sharing, entirely through documented JavaScript modules so you don&amp;rsquo;t have to call a single native function directly.
I thought that setting it up would be quite simple but unfortunately I was wrong! It is a little bit complicated to get it running and you have to figure out by yourself the mess that is Facebook&amp;rsquo;s documentation.</description></item><item><title>Array Validation in Laravel 4</title><link>https://mauricius.dev/array-validation-in-laravel-4/</link><pubDate>Sat, 30 Jul 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/array-validation-in-laravel-4/</guid><description>Introduction At work we are still using Laravel 4 for a few projects. From time to time we need to validate an array of form fields using the Laravel Validator, however before Laravel 5.2 this was not a trivial task. Let&amp;rsquo;s break down the problem a little bit.
Suppose that you want to validate a form that uses dynamic fields, added at run time by the user. Take the example of a product in an ecommerce website.</description></item><item><title>Basic ProcessWire website workflow - Part Four</title><link>https://mauricius.dev/basic-processwire-website-workflow-part-four/</link><pubDate>Sun, 12 Jun 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/basic-processwire-website-workflow-part-four/</guid><description>Introduction Following Part 1, Part 2 and Part 3.
In this post we will make the final touches and personalizations to our website. Let&amp;rsquo;s see what are going to do:
Implement a basic Sitemap Implement ProcessWire Roles and Permissions Tweak CKEditor a little bit Implement a little countermeasure to avoid bots to read emails Implement the Facebook plugin Add the cookie notification Also this post concludes this series on ProcessWire, but don&amp;rsquo;t worry, I&amp;rsquo;m planning to write again on this subject.</description></item><item><title>Easily impersonate any user in a Laravel Application</title><link>https://mauricius.dev/easily-impersonate-any-user-in-a-laravel-application/</link><pubDate>Mon, 25 Apr 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/easily-impersonate-any-user-in-a-laravel-application/</guid><description>Introduction Impersonate is quite a handy feature in some applications. It allows you to choose from a list of users and to impersonate them, in order to see the application from their point of view, without having to log out and log in again. For example, as an administrator you want to recreate a bug encountered by one of your users, without having them to share their password with you.</description></item><item><title>Basic ProcessWire website workflow - Part Three</title><link>https://mauricius.dev/basic-processwire-website-workflow-part-three/</link><pubDate>Sat, 16 Apr 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/basic-processwire-website-workflow-part-three/</guid><description>Introduction Following Part 1 and Part 2.
In this Post we will look on how to implement the PW modules introduced in Part 1. Let&amp;rsquo;s recap them:
MarkupSimpleNavigation: to generate the main navigation menu AIOM: to concatenate, minify and cache our assets MarkupSEO: the SEO solution for PW MarkupGoogleMap: to embed a Google Map on your pages ProcessSlider: to create image sliders for your pages ProcessHannaCode: to insert any complex HTML, Javascript or PHP output in your ProcessWire content There are a few methods to install PW modules.</description></item><item><title>Basic ProcessWire website workflow - Part Two</title><link>https://mauricius.dev/basic-processwire-website-workflow-part-two/</link><pubDate>Sat, 05 Mar 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/basic-processwire-website-workflow-part-two/</guid><description>Introduction Following the Part One.
In the previous article we have set the foundations, now it&amp;rsquo;s time to actually code the pages our basic website.
Template Inheritance Let&amp;rsquo;s start by explaining the concept of template inheritance. The Smarty documentation provides a nice explanation of this approach, which allows the developer/designer to compose each page by writing only the necessary code and inheriting or including the common parts that are shared.</description></item><item><title>Test Laravel filesystem storage with Virtual File System</title><link>https://mauricius.dev/test-laravel-filesystem-storage-with-virtual-file-system/</link><pubDate>Sat, 20 Feb 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/test-laravel-filesystem-storage-with-virtual-file-system/</guid><description>Introduction Since Laravel 5, the filesystem operations are abstracted thanks to the Flysystem PHP package by Frank de Jonge. This integration provides simple drivers for working with local filesystems, Amazon S3, and other Cloud Storage. The API remains the same for each system therefore is really simple to swap between each storage option.
Testing the filesystem is not an easy task. I covered some of the challenges in a previous blog post, but luckily we have a couple of tools at our disposal that can simplify considerably our work.</description></item><item><title>SQLite In-Memory Database for Unit Tests in Laravel</title><link>https://mauricius.dev/sqlite-in-memory-database-for-unit-tests-in-laravel/</link><pubDate>Mon, 01 Feb 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/sqlite-in-memory-database-for-unit-tests-in-laravel/</guid><description>Introduction When testing your code (and this is particularly true for functional tests), even if you mock most of the database iteractions, at some point you need to hit the persistent layer of your application in order to ensure that everything works correctly. In these cases you obviously are not willing to make definitive changes to your development database each time you run a test.
Luckily for us Laravel 5 provides two useful methods to solve this problem:</description></item><item><title>How to test the File System using vfsStream</title><link>https://mauricius.dev/how-to-test-the-file-system-using-vfsstream/</link><pubDate>Fri, 29 Jan 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/how-to-test-the-file-system-using-vfsstream/</guid><description>Introduction Let&amp;rsquo;s face it! In some situations, no matter how hard you try to mock everything, you have to unit test the file system in order to ensure that your application works correctly.
Testing directly the file system is a pain in the ass due to the many possible things that can go wrong. Remember: unit tests must be performed in isolation, therefore we need to make sure that each test case doesn&amp;rsquo;t affect the outcome of the others.</description></item><item><title>Inspect the response in Laravel PHPUnit tests</title><link>https://mauricius.dev/inspect-the-response-in-laravel-phpunit-tests/</link><pubDate>Mon, 25 Jan 2016 00:00:00 +0000</pubDate><guid>https://mauricius.dev/inspect-the-response-in-laravel-phpunit-tests/</guid><description>The Problem Sometimes, when running integration tests using Laravel and PHPUnit, it&amp;rsquo;s useful to inspect the response when you can&amp;rsquo;t figure out why the test is failing. In Laravel 5 and later versions, testing has been highly improved with an API that allows nice and fluent interaction with your application.
Inspect the Response Object In Laravel, each Test extends the default abstract TestCase class defined in Illuminate\Foundation\Testing. This class uses the CrawlerTrait to provide iteraction with the application, therefore it contains the $response property, which is an instance of \Illuminate\Http\Response and contains the last response returned by the application.</description></item><item><title>Basic ProcessWire website workflow - Part One</title><link>https://mauricius.dev/basic-processwire-website-workflow-part-one/</link><pubDate>Mon, 28 Dec 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/basic-processwire-website-workflow-part-one/</guid><description>Introduction For those of you who don&amp;rsquo;t know what ProcessWire is (shame on you!), here the introduction statement of the official website:
&amp;ldquo;ProcessWire is a free PHP content management system and framework (open source CMS/CMF) built to save you time and work the way you do. ProcessWire provides simpler and stronger control over your pages, fields, templates and markup at any scale.&amp;rdquo;
ProcessWire Logo In my opinion, ProcessWire is one of the most simple and effective tools for building websites, both small and large.</description></item><item><title>First steps with GraphQL in Laravel Framework - Part One</title><link>https://mauricius.dev/first-steps-with-graphql-in-laravel-framework-part-one/</link><pubDate>Wed, 09 Dec 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/first-steps-with-graphql-in-laravel-framework-part-one/</guid><description>Introduction GraphQL1 is one of the recent major technologies introduced by Facebook in the React ecosystem. Essentially it is a declarative approach for querying data from a backend.
&amp;ldquo;React is changing the way we build complex client-side UI applications. Flux rethinks the flow of data through applications. GraphQL is changing the way we fetch our data from the server.&amp;rdquo;
In a nutshell, GraphQL is challenging REST. The key concept is that the client is the only component of an application that knows best what data is needed for rendering the UI.</description></item><item><title>JavaScript Quiz Answers Explained</title><link>https://mauricius.dev/javascript-quiz-answers-explained/</link><pubDate>Mon, 30 Nov 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/javascript-quiz-answers-explained/</guid><description>Introduction JavaScript is notoriously a simple programming language, but let&amp;rsquo;s be honest: it sucks!
Don&amp;rsquo;t get me wrong! I love programming in JavaScript, it gives extraordinary freedom in building things that runs everywhere, but at the cost that is so easy to write bad code. The reason falls back to its winding history, starting from its creation in 10 days by Brendan Eich. Wikipedia has an exhaustive entry on the subject, so I suggest you to check it.</description></item><item><title>Laravel 5 Cron Jobs on shared hosting</title><link>https://mauricius.dev/laravel-5-cron-jobs-on-shared-hosting/</link><pubDate>Mon, 26 Oct 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/laravel-5-cron-jobs-on-shared-hosting/</guid><description>Introduction The Laravel documentation covers all the information you need to configure Cron Jobs on your hosting machine. Some years ago we were required to define an entry on the server for each task we needed to schedule. Now with Laravel we can simply define a single entry that interacts with the Schedule object, which will take care to run the tasks that are due.
The only Cron entry needed on the server, is the following</description></item><item><title>Five Programming Problems</title><link>https://mauricius.dev/five-programming-problems/</link><pubDate>Fri, 16 Oct 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/five-programming-problems/</guid><description>Introduction Recently I stumbled upon this blog post on ShiftedUp. The writer briefly explains that he encountered many cases of job applications for Software Engineer positions, made by people who actually have no idea of what programming means.
Then he proposes 5 coding problems to solve in less than one hour, using whatever programming language you are comfortable with. So I decided to take the challenge! The language used is JavaScript, but the examples can be written easily in any other language.</description></item><item><title>Insert a record in database for each result from a SQL query</title><link>https://mauricius.dev/insert-a-record-in-database-for-each-result-from-a-sql-query/</link><pubDate>Mon, 28 Sep 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/insert-a-record-in-database-for-each-result-from-a-sql-query/</guid><description>Just a little trick Nothing too much elaborate! This is a little useful trick to insert a record in a table for each result from a SQL query. It comes in handy for example when you have to manually populate intermediate table, in case of a many-to-many relationship.
Let&amp;rsquo;s take a basic example. Suppose that you have a list of products in your database and these products are related to a number of online stores.</description></item><item><title>Log Route calls in Laravel using Middleware</title><link>https://mauricius.dev/log-route-calls-in-laravel-using-middleware/</link><pubDate>Sun, 09 Aug 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/log-route-calls-in-laravel-using-middleware/</guid><description>Introduction Sometimes when developing a new site or application in Laravel you need to log exactly the route calls in order to track bugs and errors. This operation is straightforward.
First, let&amp;rsquo;s create a new Middleware
php artisan make:middleware LogRouteMiddleware
Then edit the handle function like the following:
&amp;lt;?php public function handle($request, Closure $next) { Log::info($request-&amp;gt;fullUrl()); return $next($request); } The fullUrl method logs the full URL including all url and query parameters.</description></item><item><title>Work on a Laravel Live Site while in Maintenance Mode</title><link>https://mauricius.dev/work-on-a-laravel-live-site-while-in-maintenance-mode/</link><pubDate>Fri, 24 Jul 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/work-on-a-laravel-live-site-while-in-maintenance-mode/</guid><description>Introduction Since Laravel 4 there&amp;rsquo;s a handy feature that allows you to put your site in maintenance mode, providing a good way to hide your changes from external eyes. This feature is really helpful on your testing or production server since it doesn&amp;rsquo;t allow users to browse the site, so you can make you modifications pretty much unnoticed.
The artisan commands are the following:
php artisan down
to put the site into maintenance mode, and</description></item><item><title>Keep URL and query parameters using manual pagination in Laravel</title><link>https://mauricius.dev/keep-url-and-query-parameters-using-manual-pagination-in-laravel/</link><pubDate>Sat, 13 Jun 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/keep-url-and-query-parameters-using-manual-pagination-in-laravel/</guid><description>Introduction The Laravel documentation is great most of the time, but when you are stuck on a particular problem you have to figure by yourself what is the solution. Recently I had to create manually a paginator instance using the LengthAwarePaginator class. The first attempt was nearly a success, here a snippet of my controller:
&amp;lt;?php $page = $request-&amp;gt;has(&amp;#39;page&amp;#39;) ? $request-&amp;gt;get(&amp;#39;page&amp;#39;) : 1; $data = $this-&amp;gt;userRepository-&amp;gt;paginate($request-&amp;gt;all(), $page); $users = new LengthAwarePaginator($data-&amp;gt;items, $data-&amp;gt;totalItems, 15, $page); Pretty straightforward!</description></item><item><title>Database Design for Bus Timetables</title><link>https://mauricius.dev/database-design-for-bus-timetables/</link><pubDate>Mon, 01 Jun 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/database-design-for-bus-timetables/</guid><description>Introduction Recently, for a large website commissioned by the local agency for tourism, I had to design a system for storing Skibus timetables. The requirements were straightforward:
store multiple bus lines; each line is a round trip, therefore it has two directions (outbound and return). But the route may not be the same; each line is effective between two dates The aim of the website was to provide timetables to regular users using standard HTML tables instead of static PDF files, allowing also mobile devices to browse them without hassle.</description></item><item><title>Efficient appended property using Laravel Eloquent</title><link>https://mauricius.dev/efficient-appended-property-using-laravel-eloquent/</link><pubDate>Tue, 19 May 2015 00:00:00 +0000</pubDate><guid>https://mauricius.dev/efficient-appended-property-using-laravel-eloquent/</guid><description>Introduction This technique is really useful to check if an Eloquent relation is loaded on a Model, in order to efficiently generate an appended property.
For example, this approach is particularly useful in a multilingual application, where you can have an entity that has a number of related translations in different languages. Consider the following code:
&amp;lt;?php class Entity extends Model { public function translations() { return $this-&amp;gt;hasMany(&amp;#39;Translation&amp;#39;); } } Our Entity class can have many translations, but the end user is interested only in the one that corresponds to his Locale.</description></item><item><title>Dropzone.js, React.js and Fluxxor integration</title><link>https://mauricius.dev/dropzone.js-react.js-and-fluxxor-integration/</link><pubDate>Sun, 14 Dec 2014 00:00:00 +0000</pubDate><guid>https://mauricius.dev/dropzone.js-react.js-and-fluxxor-integration/</guid><description>Introduction In these days I’m digging deep in the wonderful React.js library, widely used by Facebook and Instagram for their UIs. This library uses an abstraction of the DOM, called Virtual DOM, to render components in the View. Honestly I&amp;rsquo;m was not a big fan of DOM abstractions, because in my opinon it affects both the work of developers and designers. HTML should not be mixed with JavaScript and viceversa.</description></item><item><title>Durandal 2.0 folder structure and optimization</title><link>https://mauricius.dev/durandal-2.0-folder-structure-and-optimization/</link><pubDate>Sun, 24 Aug 2014 00:00:00 +0000</pubDate><guid>https://mauricius.dev/durandal-2.0-folder-structure-and-optimization/</guid><description>Folder Structure Recently, before starting a Node.js (using Locomotive.js) and Durandal project, I searched the web for the optimal folder structure. I didn’t found nothing really useful so I decided to go on using the Durandal’s convention, separating views and viewmodels, in the public folder of the Node.js application. I ended up using the following structure:
App: the main folder of the Durandal application views: HTML files of the application (V in MVC) viewmodels: the business code of the application (C in MVC) dataservices: functions that interact with the REST endpoints on the Node.</description></item><item><title>JavaScript Closures</title><link>https://mauricius.dev/javascript-closures/</link><pubDate>Mon, 15 Oct 2012 00:00:00 +0000</pubDate><guid>https://mauricius.dev/javascript-closures/</guid><description>Introduction In this new post I&amp;rsquo;m going to talk about &amp;ldquo;closures&amp;rdquo;. Just like [hoisting]({{ site.url }}/javascript-hoisting/), closures are a key concept to JavaScript, since they allow to create functions that bind the variables within a scope. Closures are usually used to build callback functions.
A good definition is available on the Mozilla Developers Network website, on which this post is entirely based.
Closures are functions that refer to independent (free) variables.</description></item><item><title>JavaScript Hoisting</title><link>https://mauricius.dev/javascript-hoisting/</link><pubDate>Wed, 10 Oct 2012 00:00:00 +0000</pubDate><guid>https://mauricius.dev/javascript-hoisting/</guid><description>Introduction In this post I am going to talk about JavaScript. Recently I rediscovered this programming language, after a long time distance caused mainly by its quirks. However while working on my thesis I started to enjoy this language and I realized how much powerful it can be, if used in the correct way.
&amp;ldquo;Do you want to work with the Web? Better learn JavaScript&amp;rdquo; said once a teacher of mine.</description></item></channel></rss>