Skip to content

Instantly share code, notes, and snippets.

View Git-I985's full-sized avatar
Focusing

Edward Konovalov Git-I985

Focusing
View GitHub Profile
@Git-I985
Git-I985 / win.ps1
Last active February 23, 2026 12:04
windows cheatsheet
# open env vars editor without clicking
Start-Process rundll32.exe "sysdm.cpl,EditEnvironmentVariables" -Verb RunAs
# open registry editor
regedit.exe
# Open registry editor on specific path
# Install https://learn.microsoft.com/ru-ru/sysinternals/downloads/regjump
# + enable advanced features for sudo (available on latest win 11 versions)
sudo regjump HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\DontPrettyPath
# Tasks scheduler
taskschd.msc
@Git-I985
Git-I985 / script.sh
Created January 6, 2026 12:12
Docker stuff
# Cleanup
docker system df -v
docker container prune
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker image prune -a
docker network prune
@Git-I985
Git-I985 / bootstrap.sh
Created October 31, 2025 21:30
Next pure boilerplate for bugs reproductions
npx create-next-app@latest [name] --empty --ts --no-tailwind --src-dir --no-linter --no-react
-compiler --app --turbopack --import-alias "@/*"
@Git-I985
Git-I985 / clear.sh
Created August 15, 2025 13:51
Clear macos safari favicon cache
# https://www.leereamsnyder.com/favicons-in-2021#clearing-the-icon-cache-in-macos-safari-is-deeply-unpleasant
rm -rf ~/Library/Safari/Favicon Cache/**/*
rm -rf ~/Library/Safari/Touch Icons Cache/**/*
rm -rf ~/Library/Safari/Template Icons/**/*
@Git-I985
Git-I985 / find-docker-files.sh
Last active April 18, 2025 19:03
Find docker files
sudo find -E . -type f \
-name "*docker*" \
-not -regex ".*node_modules.*" \
-not -regex ".*\/\.[^/]+\/.*" \
-not -regex ".*\/Library\/.*" \
-not -regex ".*\/Applications\/.*" \
-not -regex ".*\/wp-content\/plugins\/.*" \
2> /dev/null
@Git-I985
Git-I985 / avg.js
Created March 14, 2025 14:03
Avg response time measurement
async function getResponseTime() {
const start = performance.now()
await fetch('YOUR_URL_HERE')
return performance.now()-start
}
async function main() {
const times = []
for (let i = 0; i < 100; i++) {
console.clear()
!^ first argument
!$ last argument
!* all arguments
!:2 second argument
!:2-3 second to third arguments
!:2-$ second to last arguments
!:2* second to last arguments
!:2- second to next to last arguments
@Git-I985
Git-I985 / .prettierrc
Created October 19, 2024 07:38
.prettierrc
{
"printWidth": 110,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"trailingComma": "all",
"arrowParens": "always",
"bracketSpacing": true,
"pugTabWidth": 2,
@Git-I985
Git-I985 / docker-compose.yaml
Created May 28, 2024 16:07
Simple docker compose pma + mysql (phpMyAdmin + MySql)
services:
mysql:
image: mysql
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
ports:
@Git-I985
Git-I985 / railFenceCipher.js
Created November 20, 2023 11:21
Rail fence cipher
function getSteps(currentRail, numberRails) {
let step1 = (currentRail === numberRails) || (currentRail === 1) ? ((numberRails - 1) * 2) : ((numberRails - currentRail) * 2);
let step2 = (currentRail === numberRails) || (currentRail === 1) ? (step1) : ((currentRail - 1) * 2);
return [step1, step2]
}
function encodeRailFenceCipher(string, numberRails) {
let res = ''
for (let currentRail = 1; currentRail <= numberRails; currentRail++) {