Skip to content

Instantly share code, notes, and snippets.

Avatar

Larry Holst Diicorp95

View GitHub Profile
@Diicorp95
Diicorp95 / [Python 3] Precise integer base conversion.py
Created May 23, 2022
A script that precisely converts decimal integers to integers with other bases. UNLICENSE license.
View [Python 3] Precise integer base conversion.py
#!/usr/bin/python3
'''
"Precise integer base conversion"
UNLICENSE license.
'''
# - StackOverflow begin -
def convert_base(num, to_base=10, from_base=10, only_alphabet = False): # added
alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@Diicorp95
Diicorp95 / [Python 3] Remote Compilation Script.py
Last active May 8, 2022
A quirky script to compile code on remote machine (RDP, VNC, SSH...). UNLICENSE license.
View [Python 3] Remote Compilation Script.py
#!/usr/bin/python3
import os
import hashlib
import binascii
import zlib
'''
"Remote Compilation Script"
UNLICENSE license.
@Diicorp95
Diicorp95 / bytebeat04242022.js
Created Apr 24, 2022
Signed bytebeat, 44100 Hz. April 24th, 2022. Session #1. Diicorp95. UNLICENSE license.
View bytebeat04242022.js
/*
Signed bytebeat, 44100 Hz. April 24th, 2022. Session #1. Diicorp95. UNLICENSE license.
A: munching squares
B: warm noise
C: 3D triangles
D: rings
E: deeper rings
F: rings manipulations
G: Jacob's ladder (60 Hz). Best when `(2**(15-(15&t>>14))-1)` is replaced to `3` or `7`
H: hypnotic Jacob's ladder (60 Hz)
@Diicorp95
Diicorp95 / mcbook.py
Last active Mar 20, 2022 — forked from akuvfx/mcbook.py
Minecraft Book Generator
View mcbook.py
# Edited
# Aight, so it's supposed to generate commands to
# generate minecraft books. Does it work? Mebbe.
import textwrap, json
import unicodedata
from argparse import ArgumentParser
def generate(title, author, text):
"""Returns minecraft command as string."""
@Diicorp95
Diicorp95 / brute_play.py
Last active Dec 19, 2021
An extended bruteforce algorithm in Python 3: Fun modification, minified
View brute_play.py
#!/usr/bin/python3
import itertools,time,random
def br(ch,ma):return (''.join(ca) for ca in itertools.chain.from_iterable(itertools.product(ch,repeat=i) for i in range(1,ma+1)))
ke=str(bin(random.randint(0,255)))[2:];CL='\033[0m';print(CL,end='');co=0;cv=0;ok=False
for at in br('01',len(ke)):
x=str(co%7+91);print('\033[0;'+x+'m',end='');print(str(cv),">",at,'of',len(at));time.sleep(0.01);cv=co+1
if at==ke:ok=True;break
else:co+=1
print(CL)
if ok:print('Took iterations:',cv)
@Diicorp95
Diicorp95 / find_fraction.py
Created Dec 19, 2021
Find a fraction for an integer (Python 3)
View find_fraction.py
#!/usr/bin/python3
from fractions import Fraction
max_i = 10**5
max_v = 10
while True:
end = False
b = input("Find a fraction for ")[0:17].lower()
if b == "":
@Diicorp95
Diicorp95 / brute.py
Last active Dec 19, 2021
An extended bruteforce algorithm in Python 3
View brute.py
#!/usr/bin/python3
import itertools
def bruteforce(charset = '01', maxlength = 4):
return (''.join(candidate)
for candidate in itertools.chain.from_iterable(itertools.product(charset, repeat=i)
for i in range(1, maxlength + 1)))
alphabet = ''
@Diicorp95
Diicorp95 / math.root_mean_square.py
Created Dec 11, 2021
Root mean square realization in Python 3
View math.root_mean_square.py
#!/usr/bin/python3
from math import sqrt, ceil
def RMS(y):
if type(y) == list and y:
ms = 0
rms = 0
for i,j in enumerate(y):
ms = ms + j ** 2
@Diicorp95
Diicorp95 / Base64-decoding-loop_nanoseconds.py
Created Nov 4, 2021
Python 3 — Base64 decoding loop runtime counter (in nanoseconds)
View Base64-decoding-loop_nanoseconds.py
#!/usr/bin/env python3
a = 'Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tWVWJHaG9UVlZ3VlZadGNFSmxSbGw1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFkR05GU214U2JHdzFWVEowVjFaWFNraGhSemxWVm14YU0xWnNXbUZrUjA1R1UyMTRVMkpIZHpGV1ZFb3dWakZhV0ZOcmFHaFNlbXhXVm0xNFlVMHhXbk5YYlVaclVqQTFSMVV5TVRSVk1rcElaS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