Skip to content

Instantly share code, notes, and snippets.


Alexander Pletnev RusAlex

View GitHub Profile
View tmux.conf
# setxkbmap -layout us,ru -variant 'colemak,,' -option "grp:lwin_toggle" -option "ctrl:nocaps"
# setxkbmap -option "ctrl:swapcaps"
# sms
# emacs
#set-window-option -g mode-keys vi
set-window-option -g automatic-rename off
bind j select-pane -L

Keybase proof

I hereby claim:

  • I am rusalex on github.
  • I am rusalex ( on keybase.
  • I have a public key ASCzZ63iDjUP9-dJBSKkImt-ONG_BTReq3eAzCMTgT-UIwo

To claim this, I am signing this object:

View liabilities.txt
17-Jun-01 - 17-Jun-30 Liabilities:Tax:Advance 56.90 EUR 56.90 EUR
Liabilities:Tax:Employee:Health 18.58 EUR 75.48 EUR
Liabilities:Tax:Employee:Parental 0.29 EUR 75.77 EUR
Liabilities:Tax:Employee:Pension 45.29 EUR 121.06 EUR
Liabilities:Tax:Employee:Unenployment 0.41 EUR 121.47 EUR
View index.php
require 'vendor/autoload.php';
use \App\TestController;
$x = new TestController;
$app = new \Slim\App;
$app->get('/hello/{name}', \App\TestController::class.':testAction');
View index.js
let storage = [];
let tmpObject = {};
module.exports = {
refresh: function (functionNames, modificationDates) {
for (let i = 0; i < functionNames.length; i++) {
tmpObject[functionNames[i]] = modificationDates[i];
View promise.js
var p1 = new Promise(function(resolve, reject) {
setTimeout(() => {
p1.then(function(value) {
console.log(value); // Success!
}, function(reason) {
console.log(reason); // Error!

Redux folders

  • actions Action simple functions with payloads of information to change state.
  • store folder with reducers and store initialization code. Reducers:
  • stages or pages folder of "smart" react views. Views that connected to store with react-redux and their markup JSX. In redux terms files from the folder by default will return "redux containers".
  • components or views dumb views like Buttons or Text views.
  • selectors functions return part of store to connect with "smart" components. This is not a dogma and simple selectors can be also defined in stages/pages component files. Only one case when you create file in this folder, when you use the same part of app state in several stages/pages.
  • api - ...
  • triggers - service to that stays between stages/pages and api. It may decide where to

Что нового в PHP 7.1 ?

Самое необходимое. Как только мы в комании начали использовать PHP 7.x, return type declaration стал строгим правилом. На примере какого-нибудь геттера модели можно встретиться что если свойство равно NULL то и return type declaration строгое правило сработает и вызовет ошибку.

View Simple server

Simple load monitoring

First time I met task to monitor the server load. It is time when I started to think about how long I wont need new server? or Will I know when my users will start suffering from site load latency?.

I wanted to know precisely answers to my questions. Therefore started with few simple steps: log server avg load data every minute and visualize this data.

RusAlex /
Created Jul 9, 2016 — forked from etagwerker/
Bash script to perform MySQL incremental backups with Percona xtrabackup with Cron, starting with a full backup.
STAMP=`date +%Y%m%d%H%M`
echo "Iniciando backup @ $STAMP"
mkdir -p /var/backups/$STAMP
LAST_DIR=`ls /var/backups/inc | sort -n | tail -1`
xtrabackup --use-memory=1G --backup --target-dir=/var/backups/inc/$STAMP --incremental-basedir=/var/backups/inc/$LAST_DIR --user=root --password=<root-password>
echo "Fin backup @ $STAMP"