Skip to content

Instantly share code, notes, and snippets.

@Majesko
Majesko / redis.php
Created February 6, 2018 14:19
redis
private function createRedisClusterInstance($servers)
{
$attemps = self::CONNECT_ATTEMPS;
$redisInstance = null;
while ($attemps > 0) {
try {
$redisInstance = new \RedisCluster(null, $servers);
$redisInstance->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE);
$attemps = 0;
@Majesko
Majesko / nginx.conf
Created November 22, 2017 06:15
nginx optimal config
worker_processes auto;
events {
use epoll;
worker_connections 1024;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
@Majesko
Majesko / OpenWrt detect new device and send text message.md
Created October 18, 2017 07:51 — forked from jwalanta/OpenWrt detect new device and send text message.md
Detect new network devices connecting to OpenWrt and send text message
'use strict';
import axios from 'axios';
axios.defaults.baseURL = "/api";
axios.defaults.headers.common = {
'X-Requested-With': 'XMLHttpRequest',
'X-CSRF-TOKEN': document.querySelector('#token').getAttribute('value')
};
@Majesko
Majesko / oneflow.md
Created July 14, 2017 10:40 — forked from jbrodriguez/oneflow.md
a git branching model (one branch / original + hybrid variant) WIP

oneflow

A flow based on this article

Comments from Adam on the original version of this gist can be found here

Original approach

Feature branches