Skip to content

Instantly share code, notes, and snippets.

View Systerr's full-sized avatar

Andrey Logunov Systerr

View GitHub Profile
@Systerr
Systerr / parity.service
Created October 4, 2017 19:58
Parity daemon
#https://github.com/paritytech/parity/issues/6171
[Unit]
Description=Parity Daemon
After=network.target
[Service]
ExecStart=/usr/bin/parity --config /etc/parity/parity.toml
[Install]
WantedBy=default.target
@Systerr
Systerr / crontab
Last active April 8, 2021 12:44
Backup
# Execute :crontab -e
# add folow lines (create backup at 4-30 o'clock every day):
30 04 * * * /root/mysql-dump.sh
@Systerr
Systerr / gateway.php
Last active August 29, 2015 14:19
Modx bable plugin multilang
<?php
/*
Plugin for switch context for MODX REVO. Works on nginx and apache. Not required to changing server configs.
Attach plugin to event: OnHandleRequest
Each context setting is (name,key) => val (comment):
(Base URL, base_url) => / (or /en/ for english,etc)
(Culture key, cultureKey) => ru (or en for english,etc)
(Site start, site_start) => 1 (it's a ID of home document, like 404 eror page id)
(Site URL, site_url) => http://example.com/ (or http://example.com/en/ for english. Be careful, should match base_url)
*/
@Systerr
Systerr / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Systerr
Systerr / example.js
Last active August 29, 2015 14:13
Social share
$(".social-icon").on("click",function(e){
var $this = $(this);
if ($this.hasClass("vk_en")){
Share.vkontakte(location.href);
} else if ($this.hasClass("fb")){
Share.facebook(location.href);
} else if ($this.hasClass("ok")){
Share.odnoklassniki(location.href);
} else if ($this.hasClass("g_plus")){