This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (Math.floor(HTTPStatus / 100)) { | |
case 1: | |
// Informational 1xx | |
console.log("Information code " + vMsg); | |
break; | |
case 2: | |
// Successful 2xx | |
console.log("Successful code " + vMsg); | |
break; | |
case 3: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const apiMachine = new Machine({ | |
name: 'apiMachine', | |
type: 'general' | |
}) | |
apiMachine.add({ | |
details: [ lodashDetail, restDetail ], | |
components: [ apiComponent ] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gameMachine = new StateMachine({ | |
name: 'gameMachine', | |
type: 'specialized' | |
}) | |
gameMachine.add({ | |
details: [ renderDetail, controllerDetail, ], | |
components: [ playerComponent ] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Machine from 'machine.js' | |
import StateMachine from 'stateMachine.js' | |
import ViewStateMachine from 'viewStateMachine.js' | |
const fabrica = new Fabrica({ | |
details: [ storeDetail, domDetail, lodashDetail, restDetail ], | |
components: [ flashbackComponent, spectatorComponent, apinatorComponent ], | |
mechanisms: [ ], | |
machnies: { | |
ViewStateMachine, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ViewStateMachine from 'ViewStateMachine.js' | |
const frontendMachine = new ViewStateMachine({ | |
name: 'frontendMachine', | |
type: 'specialized' | |
}) | |
frontendMachine.add({ | |
details: [ viewDetail, stateDetail ], | |
components: [ flashbackComponent, spectatorComponent ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Abstract | |
const privateSingletonVariable = {}; | |
export const publicSingletonVariable = []; | |
export function publicPureFunction(arg1, arg2) { | |
return arg1 - arg2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Кейс когда лучше инкапсуляция. | |
* Необходимо создать | |
*/ | |
// Инкапсуляция | |
class Hero { | |
constructor(name, level) { | |
this.name = name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.custom-select { | |
position: relative; | |
display: block; | |
max-width: 400px; | |
min-width: 180px; | |
margin: 0 auto; | |
background-color: #bf9622; | |
z-index: 10; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Поиск дублирующихся символов. | |
* | |
* Сложность: f(n) = 4 + 4n + 8n² = O(n²) | |
* | |
* @param {string} str строка для поиска совпадений | |
* @returns {array} только дублирующиеся символы | |
*/ | |
function duplicationSymbols(str = '') { | |
const dupSymbols = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dragStartX = null; | |
let dragStarted = false; | |
let currentPositionX = 0; | |
function dragStart(e) { | |
// Клик правой кнопкой | |
if (e.button === 2) { | |
return; | |
} |