Skip to content

Instantly share code, notes, and snippets.

View HosseyNJF's full-sized avatar
🤙

M. Hosseyn Najafi HosseyNJF

🤙
View GitHub Profile
@HosseyNJF
HosseyNJF / dictionary_cache.py
Created March 10, 2024 12:40
An interface to redis HSET, wrapped in a dictionary, using django_redis.
from collections.abc import MutableMapping
from django_redis.cache import RedisCache
from redis.client import Redis
class DictionaryCache(MutableMapping):
def __init__(
self,
@HosseyNJF
HosseyNJF / README.md
Last active May 15, 2024 09:09
Delete data from exported time-series from Prometheus / VictoriaMetrics in a time range.

Usage

Note that the response cache must be deleted after these steps in order to remove previously cached results - see more details here.

@HosseyNJF
HosseyNJF / .xbindkeysrc
Created February 7, 2021 16:40
Ever wanted to switch workspaces with the buttons on the side of your mouse in Gnome? Here you are!
"wmctrl -s $(( $(xdotool get_desktop) - 1 ))"
b:9
"wmctrl -s $(( $(xdotool get_desktop) + 1 ))"
b:8
"wmctrl -r :ACTIVE: -t $(( $(xdotool get_desktop) - 1 )) && wmctrl -s $(( $(xdotool get_desktop) - 1 ))"
shift + b:9
"wmctrl -r :ACTIVE: -t $(( $(xdotool get_desktop) + 1 )) && wmctrl -s $(( $(xdotool get_desktop) + 1 ))"