Skip to content

Instantly share code, notes, and snippets.

View Hammer2900's full-sized avatar
🚚
Working from home

Yevhen Ts. Hammer2900

🚚
Working from home
View GitHub Profile
@raspberrypisig
raspberrypisig / rayguiexample.py
Created January 3, 2024 22:20
raygui raylib
from threading import Thread
from pyray import *
from raylib import *
from time import sleep
# control variables
downloadPressed = False
uploadPressed = False
@eamirgh
eamirgh / gist:650f86393b1826dd5c5e5fc68dd5f06e
Last active June 5, 2024 18:51
RESET Goland Evaluation period LINUX
rm -rf ~/.config/JetBrains/GoLand2021.3/eval
rm -rf ~/.config/JetBrains/GoLand2021.3/options/other.xml
touch ~/.config/JetBrains/GoLand2021.3/options/other.xml
sed -i -E 's/<property name=\"evl.*\".*\/>//' ~/.config/JetBrains/GoLand2021.3/options/other.xml
rm -rf ~/.java/.userPrefs/jetbrains/goland
@JohnRipper
JohnRipper / template.py
Created September 20, 2020 00:27
template for i3ipc extensions
#!/usr/bin/env python3
import i3ipc
from i3ipc import Event
from i3ipc.events import IpcBaseEvent, Event
i3 = i3ipc.Connection()
# callback for when workspace focus changes
def on_workspace(i3, e:IpcBaseEvent):
print(e.__dict__)
@chewwt
chewwt / i3-gaps.sh
Last active February 3, 2023 15:00 — forked from dabroder/i3-gaps.sh
Install i3-gaps on ubuntu 20.04
#!/bin/bash
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake libxcb-shape0-dev libxcb-xrm-dev
cd /tmp
# clone the repository
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
# compile & install
#Принудительно меняем раскладу для Konsole и kitty
#Для телеграм меняем на Русский
#Для всего остального меняю на английский
from i3ipc import Connection, Event
import subprocess,os
@ruanbekker
ruanbekker / k3s-demo-with-cluster.md
Created September 27, 2019 15:29
kubernetes demo with cluster mode on k3s

Install k3s on master node:

curl -sfL https://get.k3s.io | sh -
# get token
cat /var/lib/rancher/k3s/server/node-token

Install k3s on worker nodes as agents:

@tomdottom
tomdottom / 1-distributed-rate-limiting-of-message-queues.md
Last active May 19, 2022 13:27
Distributed rate limiting of multiple tasks queues (RabbitMQ) and the Kombu package

Basic task processing with distributed rate limiting

Proof of concept of distributed rate limiting multiple workers processing speed.

Rate limiting follows a leaky bucket algorithim. The bucket is implemented using a speical token-bucket queue. Max size of the bucket is enforced by using the max length of a token queue. The bucket is refilled by a single worker, which also is responsible for the refill rate.

Workers must get a token before fetching and processing any tasks.

@hkucuk
hkucuk / pywebview_flask_sample.py
Created July 16, 2019 20:07
PyWebView Flask Sample
from flask import Flask
import webview
import sys
import threading
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
@Birdi7
Birdi7 / callback_data_factory_simple.py
Last active May 26, 2024 19:12
A simple example of usage of callback data factory from aiogram
"""
This is a simple example of usage of CallbackData factory
For more comprehensive example see callback_data_factory.py
"""
import asyncio
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
@kapad
kapad / toggle-nightlight.sh
Created July 3, 2018 20:30
Script to toggle the Gnome nightlight setting.
#!/bin/bash
setting=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)
if [[ $setting == "true" ]]; then
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false
else
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
fi