Skip to content

Instantly share code, notes, and snippets.

View iamnnort's full-sized avatar

Nikita Pavets iamnnort

View GitHub Profile
@iamnnort
iamnnort / mysql_workbench_utf8mb4.txt
Created February 29, 2024 20:31
Mysql Workbench Dump/Restore using utf8mb4 charset
# dump
/Applications/MySQLWorkbench.app/Contents/MacOS/mysqldump --host=your_host --port=3306 --default-character-set=utf8mb4 --user=your_user --protocol=tcp -p your_database > dump.sql
# restore
/Applications/MySQLWorkbench.app/Contents/MacOS/mysql --host=your_host --port=3306 --default-character-set=utf8mb4 --user=your_user --protocol=tcp -p your_database < dump.sql
# when you see error "ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation"
From dump.sql file remove following lines:
-- SET @@SESSION.SQL_LOG_BIN= 0;
-- SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ '';
@iamnnort
iamnnort / How to mimic componentDidUpdate() with React Hooks
Created June 4, 2020 20:10
How to mimic componentDidUpdate() with React Hooks
const App = props => {
const didMountRef = useRef(false)
useEffect(() => {
if (didMountRef.current) {
doStuff()
} else didMountRef.current = true
}
}
npm install -g win-node-env
@iamnnort
iamnnort / flex-super-center
Last active April 24, 2019 07:44
Flex-box tooltips
.container {
display: flex;
}
.box {
flex: 1;
display: flex;
justify-content: center;
}
@iamnnort
iamnnort / git-tooltips.md
Created April 15, 2019 12:33
Git tooltips

git branch | grep -v "master" | xargs git branch -D - will delete all branches except master

@iamnnort
iamnnort / babel-polyfill.js
Last active February 19, 2019 09:20
babel-polyfill - error Error: only one instance of babel-polyfill is allowed
if (!global._babelPolyfill) {
import 'babel-polyfill';
}
@iamnnort
iamnnort / docker-clean-all.sh
Created September 13, 2018 09:38
Docker - Remove all builds and instances
docker stop $(docker container ls -a -q) && docker system prune -a -f --volumes
@iamnnort
iamnnort / cli
Created November 24, 2017 13:28
Magento
- Start reindex
php bin/magento indexer:reindex
@iamnnort
iamnnort / Cross element
Last active January 5, 2018 12:40
CSS: Mixins
@mixin close($color, $size: 30px) {
position: relative;
display: inline-block;
width: $size;
height: $size;
border: 0;
1.Install
sudo add-apt-repository ppa:gophers/archive
sudo apt update
sudo apt-get install golang-go
2. Insert path to ~/.bashrc
#Golang variables
export GOROOT=/usr/lib/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
3. Apply changes