Skip to content

Instantly share code, notes, and snippets.

View Quemia's full-sized avatar

Quêmia Quemia

View GitHub Profile

Create file called .babelrc in your root directory and add this code

    {
      "presets": ["next/babel"],
      "plugins": []
    }

And in .eslintrc replace the existing code with

Linux Terminal Commands


Ls

List directory contents.

Ex:

$ ls /applications

Pacman

It is a package manager that ships with most editions of Manjaro. Arch or Manjaro packages are binary, and the format of the packages is .pkg.tar.xz. The function of the pacman package manager is to make package installation easy

Pacman(Package Manager)-Synchronizes with the official Arch repositories.

AUR(Arch User Repository) - It is the repository of the Arch Linux community. It is maintained by the community and is where users upload packages that are not maintained by the official repository.

Take

returns the first n element of an array/enumeration.

Ex:

a = [1,2,3,4,5,0]
a.take(3) => [1,2,3]

a.take(30) => [1,2,3,4,5,0]

Array in Ruby

It is a list of items in order (like mangoes, apples and oranges). Each position in the list acts as a variable: you can see which object a particular position points to and can make it point to some object.

ex:

 #array empty and  array index starts at 0

var1 = []

Class Prime

Set of all prime numbers.

Ex:

def prime?(num) 
Prime.prime?(num) 
end

Range

Intervals as a sequence

The first and perhaps the most natural use of intervals is to express a sequence. Ruby creates these strings using the range operators:

".." - Creates an inclusive range. Ex:

Module

It is a collection of constant, variable and stored constant methods and a container.

It is similar to a class, but cannot be instantiated.

It is defined by the keyword module

Ex:

My First Gem

A gem is a library, a set of reusable Ruby files, labeled with a name and a version.

I

Create a basic file structure.

Ex:

When trying to install the bundle, I came across the following error:

Your Ruby version is 2.7.0, but your Gemfile specified 2.6.4

Which was resolved with the following command line:

  asdf install ruby 2.6.4

asdf local ruby 2.6.4