Skip to content

Instantly share code, notes, and snippets.

View Elijas's full-sized avatar
🦸
If nobody in the room does the right thing, that means it's your job.

Elijas Dapšauskas Elijas

🦸
If nobody in the room does the right thing, that means it's your job.
View GitHub Profile
@Elijas
Elijas / set_git_aliases.sh
Last active July 18, 2023 08:23
Convenient git aliases
# no capitalization
git config --global alias.s '!git status'
git config --global alias.pp '!git pull --no-edit && git push'
git config --global alias.c '!sh -c "git commit -m \"$*\" && git pull --no-edit && git push" -'
git config --global alias.ac '!sh -c "git add -A && git commit -m \"$*\" && git pull --no-edit && git push" -'
git config --global alias.nac '!sh -c "nbdev_prepare && git add -A && git commit -m \"$*\" && git pull --no-edit && git push" -'
# with first letter capitalization
git config --global alias.s '!git status'
git config --global alias.pp '!git pull --no-edit && git push'
@Elijas
Elijas / install.sh
Created October 23, 2022 13:37
Install custom python version
pyenv install 3.6.15
virtualenv -p ~/.pyenv/versions/3.6.15/bin/python3.6 .venv
source ./.venv/bin/activate
@Elijas
Elijas / main.py
Last active October 7, 2022 18:56
EscapeTheJail
# Quick and dirty solution to the problem; code should be cleaned up
from pydtmc import MarkovChain
def solve_jail_escape(input_str):
input_ = [list(k) for k in input_str.split('\n')]
start_i, start_j = None, None
target_i, target_j = None, None
for i, row in enumerate(input_):
@Elijas
Elijas / easy_window_drag.ahk
Last active March 8, 2024 01:14
Easy Window Drag (KDE) - Allows to drag/resize windows by clicking and dragging mouse buttons while holding a modifier key. No more sniping the windows corners - just hovering the window becomes enough.
; Easy Window Dragging -- KDE style (requires XP/2k/NT) -- by Jonny
; http://www.autohotkey.com
; This script makes it much easier to move or resize a window: 1) Hold down
; the ALT key and LEFT-click anywhere inside a window to drag it to a new
; location; 2) Hold down ALT and RIGHT-click-drag anywhere inside a window
; to easily resize it; 3) Press ALT twice, but before releasing it the second
; time, left-click to minimize the window under the mouse cursor, right-click
; to maximize it, or middle-click to close it.
; This script was inspired by and built on many like it
@Elijas
Elijas / README.md
Last active May 11, 2021 10:50
CompreFace jQuery demo
@Elijas
Elijas / Appendix.ipynb
Last active April 4, 2021 10:32
Fixed source code for "Signed Visibility Graphs of TimeSeries and their application to Brain Networks by Gunjan Soni"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Elijas
Elijas / sprendimu_medis.ipynb
Created March 21, 2021 18:20
Sprendimų medis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Elijas
Elijas / g915-on-linux.md
Last active February 10, 2024 06:32
How to fix Logitech G915 going back to rainbow after sleep on Linux

How to fix the reset to rainbow lightning effect after keyboard wakes up from sleep

Install G HUB (Windows or MacOS), connect keyboard with Lightspeed, go to Settings, and set ON-BOARD MEMORY MODE to ON. This is a one-time setup for the lifetime of a keyboard.

Other features that work on Linux

Works out of the box:

  • All the media buttons, game mode (disables the Win key), volume control. In other words, all the buttons work.
  • Pressing cycles through brightness levels.
  • Pressing + [NUM] (where [NUM] is 0, 1, 2, ..., 9) allows you to change the lightning effect on the fly.
  • Pressing + - and + + changes the lightning effect speed for the non-custom effects.
@Elijas
Elijas / pull_from_upstream.sh
Last active November 25, 2020 04:46
Pull upstream changes
#!/bin/bash -xe
UPSTREAM_REPO_URL=...
git remote add upstream "$UPSTREAM_REPO_URL" || true
git pull origin main
git checkout main
git fetch upstream
git merge upstream/main
@Elijas
Elijas / utils.py
Created October 27, 2020 23:13
Python Utils
import logging
import signal
logger = logging.getLogger(__name__)
class ExitSignalHandler(metaclass=Singleton):
def __init__(self):
self._cleanup_functions = []