Skip to content

Instantly share code, notes, and snippets.

View kirevdokimov's full-sized avatar
:octocat:

Kir Evdokimov kirevdokimov

:octocat:
  • Diagnocat.com
  • Nomading, Currently in Yerevan, Armenia
View GitHub Profile
@kirevdokimov
kirevdokimov / shell
Created April 6, 2021 16:44
Alias to run VSCode from WSL from current folder
alias vsc='powershell.exe "Start code -n ."'
@kirevdokimov
kirevdokimov / gist:86ce6c903bda13b8629d85ce39d2fedc
Created August 26, 2020 23:34
Restart nginx or show error
#! /bin/bash
if systemctl restart nginx; then
echo Ok
else
systemctl status nginx.service --no-pager --full
fi
# Run process wuth given name
bash -c "exec -a MyUniqueProcessName <command> &"
# Kill process by name
pkill -f "MyUniqueProcessName"
# Show tree of processes with pids
pstree -p
# Install pstree to debian
@kirevdokimov
kirevdokimov / Run process silent and disowned
Created May 17, 2020 23:40
Run process silent and disowned
# Run "run" script silent and disowned
./run 1>/dev/null 2>/dev/null & disown
@kirevdokimov
kirevdokimov / how to ssh
Last active May 8, 2020 22:22
How to ssh
# get pub and priv keys if dont have yet on local machine
ssh-keygen -t rsa
# paste id_pub key to .ssh/authozied_keys on remote machine
@kirevdokimov
kirevdokimov / gist:926319c28ff264c87d72d9b944883268
Created February 21, 2020 18:58
Capslock as ESC for windows
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
Scancode Map REG_BINARY
00 00 00 00 00 00 00 00
06 00 00 00 01 00 3A 00
00 00 00 00
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"AutoRepeatDelay"="200"
"AutoRepeatRate"="6"
"DelayBeforeAcceptance"="0"
"Flags"="59"
"BounceTime"="0"
https://superuser.com/questions/1058474/increase-keyboard-repeat-rate-beyond-control-panel-limits-in-windows-10
# Disable fast-forward merge for all projects
git config --global --add merge.ff false
--- Основные ветки --------------------------------
master - production-ready ветка
develop - все изданные изменения (фичи и хотфиксы)
--- Вспомогательные ветви -------------------------
--- Feature ---------------------------------------
feature branch - существует для добавления новой фичи
#Создать
@kirevdokimov
kirevdokimov / no.cs
Created February 4, 2018 19:00
Get mouse position z = 0
public static Vector3 GetWorldPointFromMouse(bool plane = true, float planeLevel = 0)
{
var groundPlane = new Plane(Vector3.up, new Vector3(0, planeLevel, 0));
var ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
RaycastHit rayHit;
Vector3 hit = new Vector3();
float dist;
if(plane)