This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
/** | |
* Recipients of notificaton about new loan registered on website. | |
* Subject is parsed by jade | |
*/ | |
'success-order-loan': { | |
from: '[email protected]', | |
to: '[email protected]', | |
subject: '| Новая заявка на заем #{id}, #{city}' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=consul-template | |
Requires=network-online.target | |
After=network-online.target consul.service vault.service | |
[Service] | |
EnvironmentFile=-/etc/sysconfig/consul-template | |
Restart=on-failure | |
ExecStart=/usr/local/sbin/consul-template $OPTIONS -config=/etc/consul-template.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FrameMessenger { | |
constructor(name) { | |
this._listeners = {}; | |
this.name = name || 'frame'; | |
this.bc = new BroadcastChannel(this.name); | |
this.bc.addEventListener('message', e => { | |
if (e.data && typeof e.data === 'object' && e.data.type) { | |
this.emit(e.data.type, e.data.data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var raw = require("raw-socket"); | |
var ip = require('ip'); | |
var util = require('util'); | |
function send(src_ip, src_port, dst_ip, dst_port) { | |
var socket = raw.createSocket({ | |
protocol: raw.Protocol.TCP, // See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml | |
addressFamily: raw.AddressFamily.IPv4 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This code is licensed under the terms of the MIT license | |
* | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const enchainProxifier = (target, promise = Promise.resolve()) => { | |
return new Proxy(target, { | |
get(target, propName) { | |
if (propName === 'promise') { | |
return promise; | |
} else if (propName === 'then') { | |
return (...args) => promise.then(...args); | |
} | |
if (target[propName] instanceof Function) { | |
return (...args) => enchainProxifier(target, promise.then(() => target[propName](...args))); |
OlderNewer