Skip to content

Instantly share code, notes, and snippets.


Artem Kuznetsov artemsky

View GitHub Profile
artemsky /
Created Jan 23, 2018
Chrome headless linux
sudo apt-get install libpangocairo-1.0-0 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libgconf2-4 libasound2 libatk1.0-0 libgtk-3-0
artemsky /
Last active Nov 6, 2020
PHP 7.2 Cloud9
sudo apt-get install python-software-properties -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml
sudo apt-get install libapache2-mod-php7.2 -y
sudo a2dismod php5
sudo a2enmod php7.2
sudo service apache2 restart
artemsky / post-checkout
Last active Jul 25, 2022
Post merge git hook to check Laravel 5+ typical resources were updated
View post-checkout
# Looks for changes and automates running bundle and other tasks.
# Does not run if your local branch is behind the remote.
# post-checkout hook - looks for changes,
# when you change branches, and if found, reinstalls the given packages every
# Exit early if this was only a file checkout, not a branch change ($3 == 1)
[[ $3 == 0 ]] && exit 0
artemsky / .gitconfig
Last active Jun 22, 2017
Phpstrom mergetool with git cli
View .gitconfig
tool = phpstorm
[mergetool "phpstorm"]
cmd = 'C:/Program Files/JetBrains/PhpStorm 2017.1.4/bin/phpstorm64.exe' merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
artemsky / prepare-commit-msg
Last active Sep 27, 2017
pre-commit hook: prepend JIRA Task Name
View prepare-commit-msg
# Automatically adds branch name to the end of every commit message.
NAME=$(git branch | grep '*' | sed 's/* //')
echo "$NAME" "$(cat "$1")" > "$1"
View maptojson.js
const mapToObject = (map) => {
const out = Object.create(null);
map.forEach((value, key) => {
if (value instanceof Map) {
out[key] = mapToObject(value);
else {
out[key] = value
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch -a 2>/dev/null | grep '\*' | grep -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
sudo apt-get -y install apparmor-utils;
sudo aa-complain /usr/sbin/mysqld
sudo service apparmor reload;
sudo aa-status
artemsky / bash
Created Mar 29, 2017
GIT - Get parent branch
View bash
git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'