Skip to content

Instantly share code, notes, and snippets.

View mrstalon's full-sized avatar
💭
Searching work

Artem Zekov mrstalon

💭
Searching work
  • Minsk, Belarus
View GitHub Profile
@mrstalon
mrstalon / ts-handbook.js
Last active March 9, 2020 11:28
Typescript Handbook
// ES6 classes
public // - access anywhere
private // - access only inside class ( without inheritance )
protected // - access only inside class and its children
readonly - // can be assigned only on default/constructor stages
static - // common property for all class instances ( as if we write it to class prototype )
abstract // - can be used only for inheritance, putting before method make method obligatory to implement ( for children )
@mrstalon
mrstalon / response.js
Created December 11, 2019 10:46
Chart response data
const response = {
total: 1000,
correct: 270,
wrong: 565,
undone: 265,
};
@mrstalon
mrstalon / letters-example.js
Created December 11, 2019 09:55
Letters example
const examples = [
'иван<span className="gray">-</span>да<span className="red">-</span>марья',
'игн<span className="green">о</span>рировать',
'иезуит',
'игн<span className="green">о</span>рировать',
'игн<span className="green">о</span>рировать',
'игн<span className="green">о</span>рировать',
'игн<span className="green">о</span>рировать',
'игн<span className="green">о</span>рировать',
];
const alphabet = [
{ letter: 'A', id: 0 },
{ letter: 'Б', id: 1 },
{ letter: 'В', id: 2 },
{ letter: 'Г', id: 3 },
{ letter: 'Д', id: 4 },
];
@mrstalon
mrstalon / task-tree.js
Last active December 11, 2019 09:25
Certain task tree object
{
total: 1000,
correct: 270,
wrong: 565,
undone: 265,
}
@mrstalon
mrstalon / tasks-tree.js
Last active December 11, 2019 09:17
Task tree request response
const taskSchema = {
title: 'Группа правил 1',
id: 12,
tasks: [
{
title: 'Правило 1.1',
id: 15,
tasks: [
{
title: 'Пункт правила 1.1.1',
@mrstalon
mrstalon / Interview-JS-core.js
Last active December 19, 2018 06:40
Some confusing and interesting topics/tasks to consider
// 1) Explain why the following doesn't work as an IIFE: function foo(){ }();
//What needs to be changed to properly make it an IIFE?
// solution & explanation
// IIFE - Immediately-Invoked Function Expressions
// The problem here is that only Function Expressions can be invoked immediately
function foo() {
console.log('foo is invoked');