I’ve always had this feeling that while learning Ruby and Rails, there were tons of little notions that I didn’t really understood. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.

Image for post
Image for post
📷 Jeremy Bishop

The generators ✨

The famous rails generate command is part of something called the rails generators.

Rails includes a lot of generators by default and the most famous one is rails new that allows us to create new rails applications.

You can access the list of all default generators by going into a rails app and typing rails generate . …


Building projects with Next.js is very easy and satisfying as a React.js developer, but it might be tricky to understand how to use ENV vars and keep them safely hidden.

Image for post
Image for post

How to store your environment variables 🤷‍♂️ 🤷‍♀️

Next.js has already done the job for you and will automatically load your env variables from .env.local . You will be able to access these variables by using process.env.MY_VAR_NAME

> yarn create next-app amazing-app // create a new app
> cd amazing-app
> touch .env.local // create a .env.local file

Here is what you should have in your favorite editor with two env. …


I’ve always had this feeling that while learning Ruby and Rails, there were tons of little notions that I didn’t really understood. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.

Image for post
Image for post
📷 Walid Ahmad

The basic definition 🤓

MIME types stands for Multipurpose Internet Mail Extensions.

As the doc says, MIME types indicates the nature and format of a document, file, or assortment of bytes.

In other words, they are used by your web browser to know what is the type of the file it has received from the server.

MIME types are everywhere 🌞

When a user navigates across your website, he / she is actually making requests to your server and your server sends back the files needed through the HTTP protocol (images, json, html, javascript etc.). …


I’ve always had this feeling that while learning Ruby and Rails, there were tons of little notions that I didn’t really understood. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.

Image for post
Image for post
📷 Sushant Vohra

The class Class

The class Class inherits directly from Module, and adds to it all the behavior related to instances. Long story short, Modules are used to add methods to one or several Classes of your app, and Classes are used to manage your objects’ properties.

Image for post
Image for post

Ps: This diagram is very very very minimalist and focus on Class, but Module and Object have a lot of other children.


I’ve always had this feeling that while learning Ruby and Rails, there were tons of little notions that I didn’t really understood. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.

Image for post
Image for post
Krivec Ales — Pexels.com

The Numeric Class

In Ruby, what we call “numbers” are all objects from the Numeric class as we can see on the following diagram :

Image for post
Image for post

Fixnum and Bignum

Fixnum are representing small integers and Bignum are representing big integers. As the doc says : “Holds Integer values that can be represented in a native machine word (minus 1 bit).”

Since ruby 2.4, Fixnum and Bignum are unified under the Integer class, so depending on your ruby version, you will get a different behavior. …

About

Olivier Dumas

Fullstack developer in love with Rails, React and Next.js Maker of stanza.dev

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