Skip to content

Instantly share code, notes, and snippets.

@DarkCat09
DarkCat09 / helloworld.py
Last active May 30, 2023 14:36
The most complicated "Hello World" in Python
# Copyright (c) 2023 Andrey Chechkenev
# MIT License
# Version 2.3
(lambda n,o:(lambda p:(lambda e,f,g,h,z,x,y,v:(lambda a,b,c,d:[c(chr(i)) for i in [*b(''.join(map(lambda j:chr(j),a.w(a)))),*d.encode('utf-8')]].sort())(type('a',(),{chr(0xff&0x7a^z):[[((k*x(2,6)&0)+k+v(y*y)) for k in [112,109,59,66,130,107,80,90,70]],[((-v(0b1000000)+(k|0x0))^0xf0) for k in [155,175,158,123,138,175,192]]],'w':lambda s:[*s.q[0xd&1],*s.q[0x80&0]]}),o(f).b64decode,o(e).stdout.write,o(g).linesep))('ysy'.translate(str.maketrans({chr(151//100+114):'y',chr(0x79):'s'})),*o('json').loads(''.join([i2 for i1,i2 in enumerate(p('XSJtN29kbjVhciJuICwiNnNvImogLCJoNDZldXNhYm4iWw==').decode('utf-8'),1) if i1%4!=0][::-1])),0x17>>(0xb&1),o('random').randint,0xf&0x8|0x9,lambda vv:-int(o('math').sqrt(vv))))(o(repr(n.object)[9]+o('string').ascii_lowercase[0]+'os'[0b1100001&1==0x1]+o('functools').reduce(lambda h1,h2:'e',(8,16))+f'{0x40}').b64decode))(__builtins__,__import__)
@DarkCat09
DarkCat09 / find.py
Last active November 6, 2022 06:07
Just compare RegExp and Python code
# s = какая-то строка
# например:
s = 'q 1'
match = 0
while match != -1:
# ищем два пробела
# начиная с пред. индекса,
# т.е. match, 2-ой аргумент
@DarkCat09
DarkCat09 / fullscreen.bat
Created October 11, 2022 07:25
Run Chrome or VLC in fullscreen mode on the 2nd display (TV in my case)
pause
"C:\Program Files\Google\Chrome\Application\chrome.exe" --start-fullscreen --window-position=1367,0 https://yt.be/
"C:\Program Files\VideoLAN\VLC\vlc.exe" "C:\Users\achec\Videos\Films\Example.avi" --video-x=1367 --video-y=769 --fullscreen
@DarkCat09
DarkCat09 / folders.txt
Created October 11, 2022 07:23
Особые папки в Windows
{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF} -Параметры проводника
{7b81be6a-ce2b-4676-a29e-eb907a5126c5} -Программы и компоненты
{8E908FC9-BECC-40f6-915B-F4CA0E70D03D} -Центр управления сетями и общим доступом
{26EE0668-A00A-44D7-9371-BEB064C98683}\3\::{7007ACC7-3202-11D1-AAD2-00805FC1270E} -Сетевые подключения
@DarkCat09
DarkCat09 / remove_preinstalled.ps1
Created October 11, 2022 07:22
Removing useless UWP applications
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Function GrantPermissions ([String]$directory)
{
takeown /f $directory
icacls $directory /grant *S-1-3-4:F /c /l
}
GrantPermissions -directory "C:\Program Files\WindowsApps"
@DarkCat09
DarkCat09 / fields.md
Last active September 17, 2022 14:58
Google's Fields API from YouTube documentation

How to use the fields parameter

The fields parameter filters the API response, which only contains the resource parts identified in the part parameter value, so that the response only includes a specific set of fields. The fields parameter lets you remove nested properties from an API response and thereby further reduce your bandwidth usage. (The part parameter cannot be used to filter nested properties from a response.)

The following rules explain the supported syntax for the fields parameter value, which is loosely based on XPath syntax:

  • Use a comma-separated list (fields=a,b) to select multiple fields.
  • Use an asterisk (fields=*) as a wildcard to identify all fields.
  • Use parentheses (fields=a(b,c)) to specify a group of nested properties that will be included in the API response.
  • Use a forward slash (fields=a/b) to identify a nested property.
  • In practice, these rules often allow several different fields parameter values to retrieve the same API response. For example, if you want to ret
@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.
@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'

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

@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"