Skip to content

Instantly share code, notes, and snippets.

View Kyu's full-sized avatar
😜
I like doing shit

Precious Kyu

😜
I like doing shit
View GitHub Profile
$code = '[DllImport("user32.dll")] public static extern bool GetAsyncKeyState(int button); public static bool IsMouseClicked() { return GetAsyncKeyState((int) 0x01); }'
Add-Type -name mouse -member $code -namespace prank;
# [prank.mouse]::IsMouseClicked()
# [Windows.Forms.Cursor]::Position = "2500, 1000"
$originalPOS = [System.Windows.Forms.Cursor]::Position
$voice = New-Object -ComObject Sapi.spvoice
$voice.rate = 0
from flask import Flask, request
import pprint
class LoggingMiddleware:
def __init__(self, _app):
self._app = _app
def __call__(self, env, resp):
error_log = env['wsgi.errors']
# Pretty print messages
# https://discord.com/developers/docs/topics/gateway#transport-compression
# https://github.com/Rapptz/discord.py/blob/8ba830eeb86a52e54c727e71436bfe0e9ea51526/discord/gateway.py#L491
import json, base64, pprint, zlib
buffer = bytearray()
zlib_obj = zlib.decompressobj()
printer = pprint.PrettyPrinter()
@Kyu
Kyu / qr.py
Created December 29, 2022 20:54
import numpy as np
import cv2
def read_camera_parameters():
cam_mtx = np.loadtxt("cam_mtx.dat")
dist_params = np.loadtxt("dist_params.dat")
# cmtx = camera matrix, dist = distortion parameters
return cam_mtx, dist_params
@Kyu
Kyu / search.ps
Created May 27, 2022 16:51
Search multiple files for text powershell
PS C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau> ls -r | Select-String ghost | select Path, LineNumber, Line
Path LineNumber Line
---- ---------- ----
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\amp.hbs 17 {{amp_ghost_head}}
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 7 {{!-- Ghost outputs...
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 8 {{ghost_head}}
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 22 {{!-- Ghost Content...
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 23 <script type="text/...
import cv2
import numpy as np
import pyzbar.pyzbar as pyzbar
img_file = "qr.png"
image = cv2.imread(img_file)
decodedObjects = pyzbar.decode(image)
for obj in decodedObjects:
print("Type:", obj.type)
java -cp java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 -lac=1 DragonBlockC-v1.4.72.jar decomp/; cd decomp; unzip -q DragonBlockC-v1.4.72.jar
@Kyu
Kyu / group_talkative.sh
Created November 18, 2020 12:20
Gets most talkative users from whatsapp archive
#!/usr/bin/bash
cat _chat.txt | sed "s|[[0-9 / , :]*][[:space:]]||" | grep -o ".*:" | sed 's/:.*//g' | tr -cd '[:print:]\r\n\t' | grep -v "^\s*$" | sort | uniq -c | sort -bnr
# cat file | replace [date/date/date , , , ] with "" | get everything before ":" | GET EVERYTHING BEFORE FIRST ":" | filter out non printing chars | idk tbh something to do with the count | idk I should man this | sorting ?? idk i shsould man this
# prints out most talkative in chat, w some false pos
# https://unix.stackexchange.com/a/39044/427069 -- sort - Get text-file word occurrence count of all words & print output sorted
# https://stackoverflow.com/a/3540639/3875151 -- bash - Removing non-displaying characters from a file
#include <iostream>
using namespace std;
int power(int a, int b) {
int pow = 1;
if (b == 0) {
return pow;
}
@Kyu
Kyu / CMakeLists.txt
Created July 11, 2019 19:23
Cmake Config for SDL2
cmake_minimum_required(VERSION 3.13)
project(ProjectName)
set(CMAKE_CXX_STANDARD 14)
add_executable(ProjectName main.cpp)
set(prefix "PATH_TO_MINGW_OR_SOMETHING_ELSE_WITH_SDL2_DEV_FILES_PASTED_INTO_IT_PATH_CANNOT_HAVE_SPACES")
#uses i686 32bit minwgw32