Skip to content

Instantly share code, notes, and snippets.

View Be1zebub's full-sized avatar
❤️
Incredible-GMod.ru

Beelzebub Be1zebub

❤️
Incredible-GMod.ru
View GitHub Profile
@Be1zebub
Be1zebub / media_hotkeys.ahk
Created March 24, 2025 14:31
put in shell:startup
; AutoHotkey Media Keys
; shift + f1
+F1:: Send "{Media_Prev}"
; shift + f2
+F2:: Send "{Media_Next}"
; shift + f3
+F3:: Send "{Media_Play_Pause}"
@Be1zebub
Be1zebub / winscp_wt_ssh.bat
Last active March 23, 2025 14:20
Run ssh sessions in winscp with openssh + windows terminal (ssh key auth only)
@echo off
REM 1. replace %ProgramFiles%\PuTTY\putty.exe in WinSCP settings (integrations > software > terminal path)
REM with "winscp_wt_ssh.bat !@ !# !U !/ !N"
REM 2. add your ssh key to ssh-agent (ssh-add %UserProfile%/.ssh/myShhKey)
REM if ssh-agent not running - use "Set-Service -Name ssh-agent -StartupType Automatic" & "Start-Service ssh-agent"
REM list of params that WinSCP sends to this batch script
REM wanna make sure its all good? add 6rd arg "debug" to this script launch params
-- darkrp textWrap fork
-- adds maxLines arg
local GetTextSize = surface.GetTextSize
local sub, gsub = string.sub, string.gsub
local function charWrap(text, remainingWidth, maxWidth)
local totalWidth = 0
text = gsub(text, ".", function(char)
@Be1zebub
Be1zebub / flaticon_dark_theme.js
Last active November 20, 2024 02:43
Ugly dark theme for flaticon.com - im too lazy to make better styles
// https://gist.github.com/Be1zebub/8e525de39d81b7a2bdb672dd8b7df10d
// tampermonkey userscript
// https://www.tampermonkey.net/
// ==UserScript==
// @name Ugly dark theme for flaticon.com
// @namespace https://www.flaticon.com/
// @version 0.1
// @description Ugly - but better than nothing, at least now i dont get flashbang. im too lazy to make better styles.
// @author https://t.me/be1zebub
@Be1zebub
Be1zebub / size_finder.lua
Created October 3, 2024 09:45
Утилита для поиска целочисленного размера изображения, на вход подается близкая к желаемой ширина и соотношение сторон.
local target_width = 180
local aspect_ratio = 16 / 9
local bounds = 32
local function calc(w)
local h = w / aspect_ratio
if math.floor(h) == h then
print(w ..", ".. h)
return true
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2024-08-30T14:11:19+00:00",
"name": "nodejs minimal",
"author": "[email protected]",
"description": "a generic egg for nodejs",
@Be1zebub
Be1zebub / ffi-terminal-size.lua
Created July 18, 2024 21:56
Функция для получения размера терминала. Я использую её для создания cli-ui
local ffi = require("ffi")
local terminalSize
if package.config:sub(1, 1) == "\\" then -- windows
local kernel32 = ffi.load("kernel32")
ffi.cdef([[
typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
uint16_t dwSizeX;
uint16_t dwSizeY;
uint16_t dwCursorPositionX;
@Be1zebub
Be1zebub / joy-cursor.lua
Created June 23, 2024 14:53
не ищите в этом смысла, я просто веселился
local traceRainbowSpeed = 360 / 2
local traceLength = 360 / 4
local trace = {}
local prevX, prevY = input.GetCursorPos()
local function DrawTrace()
local x, y = input.GetCursorPos()
do
local dx = x - prevX
-- unfinished markdown parser & renderer
local markdown = {}
do
local markdown_rules = {
{
"%*%*%*(.-)%*%*%*", "bolditalic", 3
},
{
@Be1zebub
Be1zebub / db_tester.php
Last active August 3, 2024 00:43
Script that I use for testing sql connections
<?php
$HOST = "1.1.1.1";
$DATABASE = "xxx";
$USER = "xxx";
$PASSWORD = "xxx";
$TIMEOUT = 5;
$dsn = "mysql:host={$HOST};dbname={$DATABASE};charset=utf8";
$opt = Array(