Skip to content

Instantly share code, notes, and snippets.

View r3code's full-sized avatar

Dmitriy S. Sinyavskiy r3code

View GitHub Profile
@r3code
r3code / PackSource.cmd
Created July 18, 2018 13:02
Windows batch script to pack by 7z the source code files of my project excluding some folders or files by regexp
@echo off
setlocal enabledelayedexpansion
echo Pack project sources to archive.
:SetVars
set SCRIPT_DIR=%~dp0
IF %SCRIPT_DIR:~-1%==\ set SCRIPT_DIR=%SCRIPT_DIR:~0,-1%
rem Must be installed system wide or placed in the same folder
@r3code
r3code / vue.md
Created July 18, 2018 15:33 — forked from DawidMyslak/vue.md
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modyfing state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assing() (or spread operator).

Example below explains implications for different implementations.

@r3code
r3code / fanin--concurrency-pattern.go
Last active September 24, 2019 11:37
GoLang: Concurency patterns (from Rob Pike Slides IO2010)
package main
//fanIn channel multiplexer (concurrency patterns)
// Rob Pike: Concurency patterns example from https://www.youtube.com/watch?v=f6kdp27TYZs
// playground https://play.golang.org/p/zmqbIwAy6YH
import (
"fmt"
"math/rand"
"time"
)
@r3code
r3code / golang-tls.md
Created September 27, 2019 11:44 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@r3code
r3code / conventional-commits-guide-russian.md
Last active April 15, 2025 07:09 — forked from bibendi/gist:7941823
Оформление коммитов

Общепринятые коммиты

Как писать сообщения коммитов (сообщение при фиксации кода в систему хранения версий кода), которые удобны для чтения людьми и машинами. В итоге это может дать нам возможность автоматически генерировать Changelog, и автоматически выпускать новые версии при добавлении возможностей.

За основу взято соглашение https://www.conventionalcommits.org/ru/v1.0.0-beta.4/

Для оформления сообщения коммита следует использовать следующий шаблон:

<тип>(<область>): <описание изменения>

@r3code
r3code / app.yaml
Created October 29, 2019 12:56 — forked from akhenakh/app.yaml
Example of graceful shutdown with grpc healthserver * httpserver
readinessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 1
livenessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 2
imagePullPolicy: IfNotPresent
@r3code
r3code / webstoemp-gulpfile.js
Created April 1, 2020 20:31 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@r3code
r3code / goroutinesLimit.go
Created April 19, 2020 09:21 — forked from unanoc/goroutinesLimit.go
Ограничение горутин по ресурсам. А именно, чтобы в одно время работало не больше определенного количества горутин.
package main
import (
"fmt"
"runtime"
"strings"
"sync"
"time"
)
@r3code
r3code / .gitconfig
Created May 6, 2020 19:02
Gitconfig для Windows исправить кракозябры в сообщениях git log с русскими комменариями к коммиту
; почерпнуто из https://habr.com/ru/post/74839/
; чтобы видеть нормально русские символы для git reflog нужно еще iconv
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
quotepath = false
@r3code
r3code / install_meld_as_git_mergetool.sh
Last active June 22, 2020 08:26
Install Meld as default git mergetool
git config --global merge.tool meld