Skip to content

Instantly share code, notes, and snippets.

View andrey-zakharov's full-sized avatar

Andrey Zakharov andrey-zakharov

View GitHub Profile
@andrey-zakharov
andrey-zakharov / change-git-url.sh
Last active January 18, 2024 13:55
GIT custom SSH port issue
# read git current origin url
# прочитать текущий адрес удаленного сервера git
git remote get-url origin
# write git current origin url
# записать новый адрес сервера "origin"
# git protocol not allows define custom PORT
# Протокол git не позволяет определить собственный ПОРТ
git remote set-url origin git@$URL-WITHOUT-PORT-ONLY:main/project1.git
sealed class RecursiveMap<R, T> {
class Data<R, T>(val data: T): RecursiveMap<R, T>()
class Container<R, T>(private val map: Map<R, RecursiveMap<R, T>>) : RecursiveMap<R, T>(), Map<R, RecursiveMap<R, T>> by map
}
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
Identifier: 0x57
Timestamp: 463733
Subpixel: unknown
Clones:
CRTCs: 0 1 2 3 4 5
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
filter:
System: Host: az-z690 Kernel: 5.6.19-vr1000+ x86_64 bits: 64 compiler: gcc v: 9.4.0 Desktop: Xfce 4.16.0
Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal
Machine: Type: Desktop Mobo: Gigabyte model: Z690 GAMING X v: x.x serial: <superuser/root required>
UEFI: American Megatrends LLC. v: F2 date: 10/01/2021
Memory: RAM: total: 31.20 GiB used: 3.49 GiB (11.2%)
RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU: Topology: 12-Core model: 12th Gen Intel Core i9-12900KF bits: 64 type: MT MCP arch: N/A
L2 cache: 30.0 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 152985
Speed: 1395 MHz min/max: 800/5200 MHz Core speeds (MHz): 1: 1395 2: 3381 3: 2334 4: 3322 5: 1203
@andrey-zakharov
andrey-zakharov / gist:d3f38e24618b7e65c5e7027db7af9fdb
Created September 29, 2021 18:17
export your patches to plain patch files
git log --diff-merges=none --author="$(git config user.name)" --format="format:%h#%aD#%f"| \
while IFS=# read c d m; do \
r=~/Documents/my-commits/$m.patch; \
git diff $c --output $r; touch -d "$d" $r; \
done
@andrey-zakharov
andrey-zakharov / gist:3409673eb41706b7f89337c7fca1222b
Last active September 10, 2021 11:41
bash mass batch rename
find -name OLDNAME\*png
| sed -E 's#.*STUFFTOREMOVE([0-9]+)(.*)\.png$#\0 newfancyname-\2/named_\1_art.webp#g'
| while read orig dest; do
convert $orig -write ~/some/destination/$dest; done
# convert png to webp
find -name \*png | while read p; do convert $p -write src/main/res/${p%.png}.webp; done
@andrey-zakharov
andrey-zakharov / .js
Created March 15, 2020 16:25
This is awesome
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {