Skip to content

Instantly share code, notes, and snippets.

View deitry's full-sized avatar
🤷‍♂️

Dmitry Vornychev deitry

🤷‍♂️
View GitHub Profile
@deitry
deitry / keybindings.json
Created June 9, 2022 13:33
Hotkeys for VS Code
[
{
"key": "ctrl+shift+i",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly && !editorHasSelection"
},
{
"key": "ctrl+shift+i",
"command": "-editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
@deitry
deitry / Form1.frm
Created April 29, 2022 07:33
Example of native dialog
' https://www.vbforums.com/showthread.php?786031-VB6-Using-the-new-IFileDialog-interface-for-customizable-Open-Save-(TLB-Vista-)
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "IFileDialog Example"
ClientHeight = 3615
ClientLeft = 45
ClientTop = 375
ClientWidth = 8205
@deitry
deitry / check_logs.py
Last active July 3, 2022 20:17
Python script to find given string in latest logs
from os import listdir
from os.path import join
from typing import TextIO
logsFolder = "E:\\"
filesToCheck = "test.log"
stringToFind = "check string"
# check only this count of last logs
checkOnlyLast = 10
@deitry
deitry / gen.py
Last active November 9, 2021 16:48
Generate pattern-based strings
from typing import Iterator, Dict, List
from itertools import product
from shutil import copyfile
from pathlib import Path
import random
import glob, os
EXTENSION = ".pdf"
DST_DIR = "generated"
DEFAULT_NAME = "dummy"
@deitry
deitry / vtg2-2.f90
Created August 21, 2021 08:25
Домашнее задание по курсу вычислительной теплопередачи и гидродинамики
! 2011.12.02 02.30
! =================================
PROGRAM NEYAV
! =================================
IMPLICIT NONE
!
! =================================
! ОБЪЯВЛЕНИЕ ПЕРЕМЕННЫХ
! =================================
@deitry
deitry / package.json
Created July 26, 2021 11:09
VS Code task roblem matchers for msbuild/C++
{
"name": "colcon-helper-msbuild",
"fileLocation": "absolute",
"owner": "colcon",
"pattern": {
"regexp": "^(.*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(warning|error)\\s+([A-Za-z]+[0-9]+):\\s+(.*)\\s+\\[(.*)\\]$",
"file": 1,
"location": 2,
"severity": 3,
"code": 4,
@deitry
deitry / settings.json
Created May 22, 2021 07:56
Useful keybindings for Windows Terminal
{
// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": [
{
"command": "nextTab",
"keys": [
"shift+right"
]
},
@deitry
deitry / ln.ps1
Last active April 11, 2021 08:05
Analogue of `ln` function for powershell ~ Create symbolic links (symlinks) in linux-like style
# you may add this function into $profile or other sourced file
function ln([string] $SourcePath, [string] $TargetPath)
{
if (!$SourcePath)
{
echo "Source path is empty"
}
elseif (!$TargetPath)
{
echo "Target path is empty"
@deitry
deitry / check_var.bat
Created January 27, 2021 21:45
Windows cmd batch script to check registry variable
@echo off
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_CURRENT_USER\Software\App" /v WhereIsMyMoney`) DO (
set appdir=%%A %%B
)
ECHO %appdir%
if %appdir%==0x1 (
ECHO `%appdir% is defined`
)
@deitry
deitry / .gitconfig
Created December 10, 2020 09:52
Helpful Git aliases
[alias]
sshow = "!f() { git stash show stash^{/$*} -p; }; f"
sapply = "!f() { git stash apply stash^{/$*}; }; f"
dev = !git --git-dir=\"./.git_dev\"
statys = "!f() { git status ; echo \"\n\" ; git dev status ; }; f"
findb = "!f(){ git branch -ra | grep $1; }; f"
hist = log --pretty=format:\"%ad | %h | %an: \t %s%d\" --date=short -n5
hist2 = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
dist = "!git log --pretty=format:\"%ad | %h | %an: \t %s%d\" --date=short \"$(git rev-parse --abbrev-ref HEAD)\" --not "
checkouta=checkout