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
<?php | |
// doctrine-cli.php | |
// | |
// Place into Laravel Root directory | |
// Run: php doctrine-cli.php config:show | |
// And save output to {laravel_root}/config/doctrine.php | |
// | |
// https://gist.github.com/Negasus |
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 opts struct { | |
Addr string `long:"addr" env:"ADDR" default:":3000" description:"listen address"` | |
Dbg bool `long:"debug" env:"DEBUG" description:"debug mode"` | |
} | |
func main() { | |
p := flags.NewParser(&opts, flags.Default) | |
if _, e := p.ParseArgs(os.Args[1:]); e != nil { | |
os.Exit(1) |
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
// Просьба добавить доводы по поводу использования первого либо второго варианта | |
// #1 | |
for { | |
if a1 !== b1 { | |
// .. some code 1 | |
continue | |
} | |
if a2 !== b2 { | |
// .. some code 2 |
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 gracefulStop = make(chan os.Signal) | |
signal.Notify(gracefulStop, syscall.SIGTERM) | |
signal.Notify(gracefulStop, syscall.SIGINT) | |
go func() { | |
sig := <-gracefulStop | |
fmt.Printf("caught sig: %+v", sig) | |
fmt.Println("Wait for 2 second to finish processing") | |
time.Sleep(2 * time.Second) |
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
require('strict').on() | |
local fio = require('fio') | |
local instanceName = fio.basename(arg[0], '.lua') | |
local log = require('log') | |
local instancesData = { | |
['test_1'] = {port = 3301, read_only = false}, | |
['test_2'] = {port = 3302, read_only = true}, | |
['test_3'] = {port = 3303, read_only = true}, |
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
-- get token from query argument 'token' | |
-- or from HTTP header 'Authorization' and check length | |
-- API for interaction with HTTP Request and Response | |
local http = require("http") | |
-- API for send log messages | |
local log = require("log") | |
local tokenQueryArgument = 'token' | |
local tokenHTTPHeader = 'Authorization' |
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
[providers] | |
[providers.file] | |
[http.routers] | |
[http.routers.router1] | |
Service = "service1" | |
Middlewares = ["token-validate-lua"] | |
Rule = "Host(`localhost`)" | |
[http.middlewares] |
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
require('strict').on() | |
local log = require('log') | |
vshard = require('vshard') | |
local cfg = { | |
listen = '{{ ip }}:{{ item.port }}', | |
net_msg_max = 10000, | |
readahead = 1 * 1024 * 1024, |
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
------------------- | |
s_1.lua | |
------------------- | |
require('strict').on() | |
vshard = require('vshard') | |
local storage_uuid = 'b271d109-7f1f-4db5-9f0f-625abf9050ca' | |
local cfg = { |
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
FROM tarantool/tarantool:2.x-centos7 | |
ENV TARANTOOL_INSTANCE_NAME=default | |
RUN yum -y update | |
RUN yum install -y sudo | |
RUN sudo curl -L https://tarantool.io/installer.sh | sudo -E bash -s -- --repo-only | |
RUN yum install -y cartridge-cli | |
RUN yum install -y cmake make gcc unzip git |
OlderNewer