Skip to content

Instantly share code, notes, and snippets.

View AndreVallestero's full-sized avatar
🦀

Andre Vallestero AndreVallestero

🦀
View GitHub Profile
@AndreVallestero
AndreVallestero / dynamic-hotkeys.ahk
Created April 22, 2020 19:37
Auto Hotkeys Dynamic Hotkeys
hotkeyList = 1,2,3,4,5,6,7,0,q,w,e,r,t,y,LButton,RButton
Loop, Parse, hotkeyList, `,
Hotkey, !^+%A_LoopField%, toggleKey
return
toggleKey:
varKey := "toggle" . SubStr(A_ThisHotkey, 4)
%varKey% := %varKey% ? 0 : 1
return
@AndreVallestero
AndreVallestero / delay-key-hold.ahk
Created April 26, 2020 03:22
AutoHotKey delayed key hold trigger
HOLD_TIME = 3000 ; Time required to toggle key in milliseconds
KEY_TO_TOGGLE = g ; Key to toggle on and off
~LButton::
hold_until_tick := A_TickCount + HOLD_TIME
SetTimer, ToggleKey, % -HOLD_TIME
return
ToggleKey:
if (A_TickCount >= hold_until_tick and GetKeyState("LButton"))
@AndreVallestero
AndreVallestero / multirunner_racer.py
Last active April 27, 2020 02:59
Async multirunner racer with auto task spawning for python by runie
from asyncio import Event, create_task, run, sleep, Task
from random import randint
class MultiRunner:
def __init__(self, coro, n):
self._coro = coro
self._n = n
self._result = None
self.args = []
from asyncio import Event, create_task, Task, gather, Queue, get_event_loop, run, sleep, wait, ensure_future
from concurrent.futures._base import CancelledError
from aiohttp import ClientSession
from proxybroker import Broker
from time import time
class Aphro:
def __init__(self, pool_size = 8, valid_codes = [[200, 300]], timeout = 900,
proxies = [], min_proxies = 8, max_proxies = 12,
proxy_sample_th = 8, proxy_rate_th = .5):
;; Note: Dummy pattern description used for 'Solid fill'.
*SOLID, Solid fill
45, 0,0, 0,.125
*ANGLE, Angle steel
0, 0,0, 0,.275, .2,-.075
90, 0,0, 0,.275, .2,-.075
*ANSI31, ANSI Iron, Brick, Stone masonry
45, 0,0, 0,.125
*ANSI32, ANSI Steel
45, 0,0, 0,.375
@AndreVallestero
AndreVallestero / docker-compose.yaml
Last active October 10, 2022 10:34 — forked from joenas/docker-compose.yaml
Matrix docker-compose with Postgres and docker network
# https://jonnev.se/matrix-homeserver-with-docker/
# https://adfinis.com/en/blog/how-to-set-up-your-own-matrix-org-homeserver-with-federation/
# https://zerowidthjoiner.net/2020/03/20/setting-up-matrix-and-riot-with-docker
# https://tech.davidfield.co.uk/setting-up-your-own-riot-im-server/
# https://matrix.org/blog/2016/02/10/advanced-synapse-setup-with-lets-encrypt
version: "3"
services:
postgres:
@AndreVallestero
AndreVallestero / surf.cfg
Last active August 31, 2020 13:17
surf settings surfing config csgo cs go
cl_dm_buyrandomweapons 0;
cl_drawhud_force_radar -1;
cl_showpos 1;
sv_cheats 1;
sv_accelerate 10;
sv_accelerate_use_weapon_speed 0;
sv_airaccelerate 400;
sv_autobunnyhopping 1;
sv_deadtalk 1;
@AndreVallestero
AndreVallestero / framegrabber.py
Last active March 18, 2021 15:16
A faster, lower latency frame grabber.
import win32gui, win32ui
from win32con import SRCCOPY
from numpy import fromstring
'''
Optimized to be 6 times faster using the following techniques
- Reuse bitmaps, handles, and device contexts
- Use the application framebuffer instead of the compositor frame buffer(entire desktop)
This is not the fastest method. That would be to directly copy the data from the GPU back buffer
@echo off
REM Install Virtual Audio Cable https://vb-audio.com/Cable/
REM Enable go to VAC recording device and enable listening on default playback device
REM Have anything you want recorded set to output to VAC Input (playback device)
REM To find out your microphone device name use the following:
REM ffmpeg -list_devices true -f dshow -i dummy
set microphone="Microphone (Yeti Stereo Microphone)"
echo Press q to stop
ffmpeg -v 0 -stats ^
@AndreVallestero
AndreVallestero / av1an-av.py
Last active March 8, 2021 04:38
Scene threaded transcoder utility
# pip install av scenedetect opencv-python
from os import cpu_count, mkdir, path
from tempfile import mkdtemp
from subprocess import Popen, PIPE
from concurrent.futures import ThreadPoolExecutor
from av import open as av_open, format as av_format
from scenedetect.detectors import ContentDetector
from scenedetect.scene_manager import SceneManager
from scenedetect.video_manager import VideoManager