Skip to content

Instantly share code, notes, and snippets.

View oleksandr-petryk's full-sized avatar

Oleksandr Petryk oleksandr-petryk

View GitHub Profile

Get arguments in Node.js

Code:

function getArgs() {
  return process.argv.slice(2);
}

console.log('Args: ', gerArgs());

Loading animation in pure Node.js

Code:

const loading = () => {
  const view = ['|', '/', '-', '\\'];
  let i = 0;

 setInterval(() => {

Regular expressions

Syntax example:

/expression/

Good resource to training skills in regular expressions regexr.com or regex101.com

Make square blocks in CSS grid

I tried several times to do this, and I found a solution.

The code:

.grid-block {
  display: grid;
 grid-template-columns: repeat(7, 1fr);