Skip to content

Instantly share code, notes, and snippets.

View SerhiiHulii's full-sized avatar
🏠
Working from home

Serhii Hulii SerhiiHulii

🏠
Working from home
View GitHub Profile
@SerhiiHulii
SerhiiHulii / nodejs-cheatsheet.js
Created December 30, 2022 09:11 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@SerhiiHulii
SerhiiHulii / bash-cheatsheet.sh
Created December 30, 2022 09:07 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@SerhiiHulii
SerhiiHulii / multiple_ssh_setting.md
Created December 29, 2022 15:44 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@SerhiiHulii
SerhiiHulii / ModalController.vue
Created June 29, 2021 10:24
Vue Promised Modals
<template>
<div class="modal-wrapper" @click="clickModalWrapper">
<transition name="fade">
<template v-if="getComponent">
<component :is="getComponent" />
</template>
</transition>
</div>
</template>
@SerhiiHulii
SerhiiHulii / disable-scroll.js
Created June 29, 2021 10:12
Disable scroll for modal
disableScrolling () {
document.querySelector('body').style.overflow = 'hidden'
},
enableScrolling () {
document.querySelector('body').style.overflow = 'auto'
}
@SerhiiHulii
SerhiiHulii / main.js
Last active November 19, 2021 14:43
fix 100vh for phones
function setHeightProperty() {
const vh = window.innerHeight * 0.01
document.documentElement.style.setProperty('--vh', `${vh}px`)
}
function initResizeObserver() {
setHeightProperty()
window.addEventListener('resize', () => {
setHeightProperty()
})
@SerhiiHulii
SerhiiHulii / reactLifeHooks.js
Last active June 28, 2021 22:12
From Vue to React migration
import React, {useEffect} from 'react';
const Exapmle = () => {
useEffect(() => { // if 2nd argument is not exists will be called with every call of render() function. On 'mouting' and 'updated'
console.warn('render() === [mounted && updated]')
})
useEffect(() => { // if 2nd argument is exists but empty, will be called only one time in 'mouting'
console.error('mounted')
return () => { // if mounting will return funtion will be called on 'beforeDestroy' hook