Skip to content

Instantly share code, notes, and snippets.

View ivanstepanovftw's full-sized avatar
🏳️‍🌈

Ivan Stepanov ivanstepanovftw

🏳️‍🌈
View GitHub Profile

When I click middle mouse button, and current window name is "Visual Studio Code", instead of middle mouse click do left mouse click and then F12. I am using Fedora.

To achieve this behavior in Fedora, you can use a combination of xdotool and a custom script. Here's a step-by-step guide:

  1. Install xdotool: This is a command-line tool that allows you to simulate keyboard and mouse input.

    sudo dnf install xdotool
  2. Create a script: This script will check the current window name and perform the desired actions.

@ivanstepanovftw
ivanstepanovftw / .hungarian_loss.py
Last active March 29, 2024 23:10
PyTorch implementation of the Hungarian loss function, a permutation invariant loss, with SciPy assignment problem solver. The "MIT No Attribution" (MIT-0) License.
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from scipy.optimize import linear_sum_assignment
from torch.utils.data import DataLoader, TensorDataset
class SimpleBoundingBoxPredictor(nn.Module):
def __init__(self):
@ivanstepanovftw
ivanstepanovftw / fcn_conways_game_of_life.py
Last active March 24, 2024 15:09
Conway's Game of Life using only convolutions with hand-made weights. Implementation in PyTorch of paper: "It's Hard for Neural Networks To Learn the Game of Life" https://arxiv.org/abs/2009.01398
import logging
import plotly.graph_objects as go
import torch
import torch.nn as nn
import torch.nn.functional as F
from plotly.subplots import make_subplots
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(message)s", datefmt="%H:%M:%S")
@ivanstepanovftw
ivanstepanovftw / PowerSerttings.Unhide.reg
Created October 20, 2023 19:36 — forked from Dark4Codrutz/PowerSerttings.Unhide.reg
Reveals the most used hidden power settings in Windows 10. The value Attributes=2 means reveal, where value of 1 or 0 means hide from Power Options. Good Tweaking!
Windows Registry Editor Version 5.00
;Reveals the most used hidden power settings in Windows 10. The value Attributes=2 means reveal, where value of 1 or 0 means hide from Power Options.
;Good Tweaking!
;WLAN
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\19cbb8fa-5279-450e-9fac-8a3d5fedd0c1\12bbebe6-58d6-4636-95bb-3217ef867c1a]
"Attributes"=dword:00000002
;Power Scheme Personality
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\245d8541-3943-4422-b025-13a784f679b7]
@ivanstepanovftw
ivanstepanovftw / bonus.py
Created June 29, 2023 14:36
Python implementation of Computing Inverse Optical Flow (2013, Javier Sánchez et al)
def flow_disocclusion(flow: np.ndarray) -> (np.ndarray):
h, w, _ = flow.shape
remap_flow = flow.transpose(2, 0, 1)
remap_xy = np.float32(np.mgrid[:h, :w][::-1])
uv_new = (remap_xy + remap_flow).round().astype(np.int32)
mask = (uv_new[0] >= 0) & (uv_new[1] >= 0) & (uv_new[0] < w) & (uv_new[1] < h)
uv_new_ = uv_new[:, mask]
mask_remaped = np.zeros((h, w), np.int8)
mask_remaped[uv_new_[1], uv_new_[0]] = 255
return mask_remaped
@ivanstepanovftw
ivanstepanovftw / # My Fedora post-install setup.md
Last active April 6, 2023 19:25
## My opinioned Fedora post-install setup

My Fedora post-install setup

@ivanstepanovftw
ivanstepanovftw / # Internet checker.md
Created December 19, 2022 13:36
Is WiFi or internet is down?

Internet checker

i19 for Rust

Compile-time internationalization with runtime language switch and plural/genders support

License

MIT-0

My youtube-dl scripts

  • video-dl - download videos via yt-dlp using aria2c with multiple connections.
  • playlist-dl - download playlist into folder using video-dl.

Works in WSL2.

Installation:

curl https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
sudo mv yt-dlp /usr/bin