Skip to content

Instantly share code, notes, and snippets.


Eduard edwardstock

  • Turkey, Antalya
View GitHub Profile
edwardstock /
Created Sep 13, 2018
GIT revert file mode changes
#!/usr/bin/env bash
cd $1
git diff -p -R --no-color | grep -E "^(diff|(old|new) mode)" --color=never | git apply
## add git alias with name "permission-reset"
git config --global --add alias.permission-reset '!git diff -p -R --no-color | grep -E "^(diff|(old|new) mode)" --color=never | git apply'
edwardstock /
Created Aug 31, 2018
Android Decimal Number Input Filter
public class DecimalInputFilter extends android.text.method.DigitsKeyListener {
private final WeakReference<EditText> mView;
private int mDecimals = 18;
public DecimalInputFilter(EditText txtView) {
this(txtView, 18);
public DecimalInputFilter(EditText txtView, int decimals) {
super(false, true);
edwardstock /
Last active Mar 1, 2019
GNU GCC 8.1 automated build script
# init new database
# dir: /usr/pgsql-$VERS
initdb -A trust --auth-local=trust --encoding=UTF8 --pgdata=/var/pgsql10
# dump old database (-O [--no-owners] - drops owners assignment, by default in new db's rights will grant to importer)
pg_dumpall -O -U postgres > /var/db.out
# import database dump
psql -f db.out postgres
yum install centos-release-scl
yum install devtoolset-7-gcc*
# enable bin (originally installed to /opt/rh/devtoolset-7/root/ )
# scl exports to $PATH /opt/rh/devtoolset-7/root/bin/*
scl enable devtoolset-7 bash
# check
`which g++` -v
edwardstock /
Last active Apr 2, 2018 — forked from 1duo/
Install Boost library from source on CentOS 7.
  • Unzip
tar -xzf boost_1_65_1.tar.gz &amp;&amp; cd boost_1_65_1
View atlas-mvn-push.gradle
* Copyright 2017 Eduard Maximovich
* Atlas
apply plugin: 'maven'
version = VERSION_NAME
group = GROUP
edwardstock / .gitignore
Created Aug 11, 2017 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
# Packages #
edwardstock /
Created Aug 11, 2017
How to GIT ignore: global ignoring files
# Command to use global .gitignore file:
touch ~/.gitignore
echo ".DS_STORE" >> ~/.gitignore
echo ".idea/" >> ~/.gitignore
git config --global core.excludefile '~/.gitignore'
edwardstock / gcc 5 on ubuntu 14.04
Created Jul 1, 2017 — forked from beci/gcc 5 on ubuntu 14.04
use gcc 5.x on ubuntu 14.04
View gcc 5 on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5