Skip to content

Instantly share code, notes, and snippets.

View Sasha-hk's full-sized avatar
🏠
Working from home

Oleksandr Petryk Sasha-hk

🏠
Working from home
  • Ukraine
  • 02:42 (UTC +03:00)
View GitHub Profile

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);

Regular expressions

Syntax example:

/expression/

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

Loading animation in pure Node.js

Code:

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

 setInterval(() => {

Get arguments in Node.js

Code:

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

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

Input function in pure Node.js

Code:

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

Good design tips for your README file

Describe:

  • what is your project about
  • tech stack
  • APIs you use
  • database structure on the chart
  • API reference
  • requirements document

GitHub Actions continuous deployment workflow

Workflow config:

name: CD

on:
  push:
 branches:

Debugging C++ with VS Code on linux

Launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
 "version": "0.2.0",

Make file example

CC=g++
CFLAGS=-g -w -Wall

main: main.o
	$(CC) $(CFLAGS) -o main main.o

main.o: ./src/main.cpp algorithm.o cli.o