Skip to content

Instantly share code, notes, and snippets.

@andreyka26-git
andreyka26-git / gitlab-runner-dind-setup.txt
Last active February 8, 2023 12:43
GitLab runner in docker (using dind) with sample gitlab.ci set up
** run these commands inside your machine
docker run -v /srv/gitlab-runner/config:/etc/gitlab-runner --name runner -v /var/run/docker.sock:/var/run/docker.sock -d gitlab/gitlab-runner
docker exec -it runner bash
gitlab-runner register -n \
--url "https://gitlab.com/" \
--registration-token "qSf6YzdsXjMug69WxVTt" \
--executor "docker" \
@andreyka26-git
andreyka26-git / gist:3af4c4b4f39dbf3df462a9df9003dfc7
Created July 20, 2022 07:52
nginx dynamic proxy_pass with routes (explaining in the source code)
# this config resolves different containers depending on route path, not on ips/domains
# on top of that it uses dynamic resolving, meaning that if some docker containers are not alive
# nginx will still work. It is achieved by using variables which makes nginx resolve host on runtime and not on start.
# frontend dev env
server {
# nginx container port
listen 3001;
server_name localhost;
@andreyka26-git
andreyka26-git / js
Created July 25, 2022 09:36
Google Docs Add today's date with heading
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Services')
.addItem('Add Day', 'addNewDay')
.addToUi();
}
function formatTwoDigit(n) {
return n < 10 ? '0' + n : '' + n;
@andreyka26-git
andreyka26-git / project.csproj
Last active March 11, 2024 20:08
.csproj set target path of copied file
<!--
To know <sourcepath> you might just select proprties of the file in Visual Studio and select "Copy To Output Directory = Copy if Newer"
It will add record to csproj with <sourcepath> included.
<targetpath> is the path from the build directory <projectsrc>/bin/x64/Debug/*
-->
@andreyka26-git
andreyka26-git / partitions-flip-traffix.cs
Created July 25, 2024 16:06
The case when we choose bad hash function resulting in flip of the traffic
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
var dict = new Dictionary<string, int>
{
["euwe-0"] = 0,
["euno-0"] = 0,
["euwe-1"] = 0,
["euno-1"] = 0,
@andreyka26-git
andreyka26-git / .ideavimrc
Created March 12, 2025 11:52
Vim motions plugin configuration
"" Source your .vimrc
"source ~/.vimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
@andreyka26-git
andreyka26-git / karabiner-mac.json
Last active June 3, 2026 14:35
Karabiner vim setup (mac)
{
"description": "Windows Keyboard Fix + Vim Navigation (Caps/Right-Alt)",
"manipulators": [
{
"description": "Caps Lock: Hold for Vim Mode, Tap for Escape",
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": ["any"] }
},
"to": [
@andreyka26-git
andreyka26-git / VimMode.ahk
Last active June 3, 2026 14:35
VimMode for Windows via AutoHotkey
#Requires AutoHotkey v2.0
SetCapsLockState "AlwaysOff"
global visualMode := false
; ============================================================
; VIM-STYLE KEYBOARD NAVIGATION FOR WINDOWS
; ============================================================
;
; CapsLock is repurposed as a modifier key. Hold it + press a
; key to trigger vim-style motions. Tap CapsLock alone does nothing.