onoya.dev

Creating Monorepos using Lerna

Today I want to share a library that I’ve recently learned called Lerna. It’s a tool for managing monorepos. Monorepos are repositories that contains multiple packages. Many projects like React and Babel develop their packages in a single repository. Before…

React + Webpack + Babel 7 + TypeScript Starter

I have been recently working on projects that uses TypeScript with React. The easiest way to get started working with React + TypeScript is through the create-react-app boilerplate. (react-scripts@2.1.0 and above now supports typescript) You can now easily add TypeScript…

Enable Absolute Path Imports in Create React App

In this article, I’ll be showing you how to enable absolute path imports in a create-react-app application without ejecting. To enable absolute path imports, you just have to configure the baseUrl of your project’s jsconfig.json file. (tsconfig.json if you are using…

Setup a Ruby on Rails Application with Docker from Scratch

This is a basic development environment setup for Ruby on Rails application with MySQL using Docker and Docker Compose. You can find the instructions on how to install Docker from here. If you are using Docker for Mac/Windows, then Docker Compose is already…

Render Multiple Components in ReactJS with Fragments

Render Multiple Components Prior to Version 16 Prior to version 16, the easiest way to render multiple components was by wrapping the components in a single parent element. But with this method, you are adding an unnecessary extra node to…

Deploy a Dockerized CakePHP 2.x App with Docker Cloud

IMPORTANT!Cluster Management in Docker Cloud has been discontinued on May 25. Therefore, instructions below won’t work anymore. I’ll be creating a new article on how to deploy your app in Digital Ocean using Docker Swarm. So stay tuned! In this blog…

Setup CakePHP 2.x Application with Docker from Scratch

This is a basic setup of CakePHP application (specifically for version 2.x) with Docker. There are a lot more things you can do with Docker. This article is to help you get started. You may download the final result of…

Integrate ReactJS to a CakePHP 2.x Application from Scratch

This is a basic integration of ReactJS into a CakePHP 2.x application. Before we start, make sure you already have a running CakePHP 2.x application. If you don’t have a running CakePHP app, you may clone this basic CakePHP 2.x…

Installing CakePHP 2 Using Composer

So I was trying to update and refactor a legacy code that I was working on which used CakePHP 2. I also have to update the CakePHP version since it was really outdated. The first approach I took was to…

How to install Ruby on macOS using RVM

In this article, I’m going to show you how to install Ruby with RVM on a macOS machine. You’ll also learn how to install a specific version. Install GPG Install RVM RVM stands for Ruby Version Manager. It allows you…

CakePHP 2 Unit Test Mocking — Prevent assigning different Alias

Problem: Mock If you have tried Mocking models, you might have encountered some problems especially for models that have Associations. One of those problem is, when you mock a model, it assigns an alias. For example: model User will become Mock_User_b13d6ac9. That will cause…