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
# 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
@Kyu
Kyu / mp3-to-m4r.bat
Created May 23, 2018 01:22 — forked from TheZoc/mp3-to-m4r.bat
Convert a MP3 file to an Apple iPhone's ringtone file (M4R), using FFMPEG.
@echo off
rem =====================================================
rem Converts a MP3 file to a M4R file using ffmpeg.
rem Usage: Drop a MP3 file at the top of this batch file.
rem =====================================================
rem %~f1 = Full File Path, with drive letter
rem %~p1 = Drive Letter
rem %~p1 = Path Only
rem %~n1 = File Name
@Kyu
Kyu / sqlite-to-mysql.py
Created January 2, 2018 15:19
converts sqlite to mysql
#Incomplete
from sqlalchemy import (
create_engine,
MetaData,
Table
)
from sqlalchemy.orm import sessionmaker
sqlite_engine = create_engine('sqlite:///main.db', echo=True)