Skip to content

Instantly share code, notes, and snippets.

@DarkCat09
DarkCat09 / map.ino
Created March 29, 2021 03:33
Wiring C++ function map()
// https://www.arduino.cc/reference/en/language/functions/math/map/
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
@DarkCat09
DarkCat09 / irrverbs.js
Last active April 28, 2021 15:54
List of irregular verbs in a two-dimensional array (JavaScript) / Список неправильных глаголов в двумерном массиве (JavaScript)
/* Почти все неправильные глаголы
*
* http://pro-lingua.ru/vse-nepravilnyie-glagolyi-angliyskogo-yazyika/
* © 2021 Pro-lingua.Ru
*
* Моя регулярка для парсинга списка глаголов:
* https://regexr.com/5rnre
*
*/
all_irregular_verbs =
@DarkCat09
DarkCat09 / parts.sql
Created June 24, 2021 12:51
MySQL: Add all the parts of Teen Wolf 3 to the table
DELIMITER //
CREATE PROCEDURE TEENWOLF_PARTS ()
BEGIN
DECLARE I INT DEFAULT 24;
WHILE I > 0 DO
INSERT INTO `parts` (`FilmId`,`PartNum`,`Filename`)
VALUES (20,25-I,CONCAT('C:\\Users\\***YOUR_USERNAME***\\Videos\\Films\\Teen_Wolf_3\\Teen_Wolf_03',LPAD(CONVERT(25-I,VARCHAR(2)),2,'0'),'_WEB-DLrip_VO-production.avi'));
SET i = i - 1;
END WHILE;
END//
@DarkCat09
DarkCat09 / Debian11_postinstall.md
Last active October 12, 2021 11:29
Что нужно сделать после установки Debian 11. Источник: https://disk.yandex.ru/d/k3JohOmhihlcEg

Несвободное ПО

  • su -
  • nano /etc/apt/sources.list
  • Добавить non-free в конце всех строк:
deb http://mirror.corbina.net/debian bullseye main contrib non-free
deb-src http://mirror.corbina.net/debian bullseye main contrib non-free

deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free
@DarkCat09
DarkCat09 / main.py
Created October 26, 2021 12:15
Find keywords in files using Python / Поиск ключевых слов в файлах через Python
import os
import re
# Лог-файл:
txt = open('result.txt', 'wt')
# Берём список файлов
files = os.listdir()
# Каждый файл...
@DarkCat09
DarkCat09 / bbpixelart.py
Last active March 30, 2022 11:35
Convert your picture to a pixel art on forum code!
from PIL import Image
from typing import List, Tuple
scale = 28
def smallres(file:str) -> Image:
img = Image.open(file)
ratio = scale / max(img.size[0], img.size[1])
w = img.size[0] * ratio
h = img.size[1] * ratio
@DarkCat09
DarkCat09 / floating.sh
Last active April 2, 2022 10:53
Start an application in a floating window (SkyolineHelper)
#!/system/bin/sh
PKG=ru.fourpda.client
ACT=MainActivity
am start \
-a android.intent.action.MAIN \
-c FLAG_TEMP_WINDOW \
-c android.intent.category.LAUNCHER \
-c FLAG_FLOATING_WINDOW -f 0x10000000 \
"$PKG/.$ACT"

5.612 м/с - бег 4.316 м/с - ходьба

@DarkCat09
DarkCat09 / onecompiler_curl.sh
Last active August 19, 2022 14:36
OneCompiler Private API (free)
JSCODE='(() => console.log(123))();'
# ---------------------------------
# Do not edit below this line
DATA=$(echo -n '{"name":"JavaScript","title":"JavaScript Hello World","version":"ES6","mode":"javascript","description":null,"extension":"js","languageType":"programming","active":true,"properties":{"language":"javascript","docs":true,"tutorials":true,"cheatsheets":true,"filesEditable":true,"filesDeletable":true,"files":[{"name":"HelloWorld.js","content":"-##CODE##-"}]},"visibility":"public"}' | sed "s/-##CODE##-/$JSCODE/")
curl 'https://onecompiler.com/api/code/exec' \
-X POST -d "$DATA" \
-H 'Content-Type: application/json; charset=utf-8'
@DarkCat09
DarkCat09 / list.md
Created September 8, 2022 13:45
My Discord bots

New projects

Coming soon

Old projects

  • CatMusic downloads music from YT and plays it in a voice channel.
  • PicTools can process your picture with Pillow functions.
  • GetP2P finds the specified content on rutor.org and sends you a torrent file.
  • VTDiscord scans your file on VirusTotal and returns result.