Skip to content

Instantly share code, notes, and snippets.

View yarkovaleksei's full-sized avatar
🏠
Working from home

Yarkov Aleksey yarkovaleksei

🏠
Working from home
  • Russia, Rostov-on-Don
View GitHub Profile
@yarkovaleksei
yarkovaleksei / bash.sh
Created February 10, 2017 19:26 — forked from jbutko/bash.sh
Nginx
# upgrade nginx
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
# cache
proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g
inactive=60m use_temp_path=off;
server {
@yarkovaleksei
yarkovaleksei / Social RESTful URLs snippet.md
Created February 10, 2017 17:46 — forked from dr-dimitru/Social RESTful URLs snippet.md
Social links, +1s and shares using only HTML (no JS)
#!/bin/bash
port=9100
echo {1..255}.{0..255}.{0..255}.{0..255}:${port} | sed 's/\s/\n/g'
var obj = new Proxy({}, {
get: function (target, key, receiver) {
console.log(`getting ${key}!`);
return Reflect.get(target, key, receiver);
},
set: function (target, key, value, receiver) {
console.log(`setting ${key}!`);
return Reflect.set(target, key, value, receiver);
}
});
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function demo() {
console.log('Taking a break...');
await sleep(2000);
console.log('Two second later');
}
/* This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9/modified to conform to commonjs modules pattern
Author: Stefan Goessner/2006
Web: http://goessner.net/
*/
var json2xml = (typeof exports === 'undefined')? {} : exports; // like commonjs
//Node.js build for pandoc convert md 2 rst
{
"shell_cmd": "pandoc -f markdown -t rst $file > $file_path/$file_base_name.rst"
}
@yarkovaleksei
yarkovaleksei / 1: helloworld
Created November 21, 2016 00:27 — forked from marthall/1: helloworld
Very basic python packaging
#!/usr/bin/env python
print "Hello World"
find . -d -name node_modules | while read line; do rm -rf $line; done
[Собираем свой debian-пакет с файлами](https://debian.pro/1390)
[Простейший способ собрать свой deb-пакет с данными (например, с конфигами, скриптами, ключами авторизации)](https://debian.pro/426)