Skip to content

Instantly share code, notes, and snippets.

View aziascreations's full-sized avatar
💭
Why is this even a feature ?

Herwin Bozet aziascreations

💭
Why is this even a feature ?
View GitHub Profile
# Imports
import logging
import threading
from typing import Callable, Union
import ywg.utils.logger as logger_util
# Code
class Worker:
@aziascreations
aziascreations / breaknesting.py
Created June 25, 2021 23:41
Split directory fixer
import os
import shutil
import json
import re
def is_contained_inside_2d_array(element, index, array):
for arr_elem in array:
print(element)
if arr_elem[index] == element:
@aziascreations
aziascreations / ThreadedWorkerTemplate.pb
Created November 7, 2020 11:10
ThreadedWorkerTemplate.pb
;- Compiler directives & imports
EnableExplicit
CompilerIf #PB_Compiler_Thread = 0
CompilerError "Required: Thread-safe compiler flag."
CompilerEndIf
@aziascreations
aziascreations / IPV4Helper.pbi
Created May 22, 2020 11:33
PB Threaded ARP Requests
;{- Code Header
; ==- Basic Info -================================
; Name: IPv4Helper.pbi
; Version: 0.0.1
; Author: Herwin Bozet
; Create date: 21 ‎June ‎2019, 19:24:33
;
; Description: A basic set of utility procedures and macros to help with IPv4 addresses.
;
; ==- Compatibility -=============================
@aziascreations
aziascreations / EndianUtils.pbi
Last active May 16, 2019 01:34
Generate a sine wave at a fixed frequency and save it in a .wav file
;EnableExplicit
; Original ASM code for .l
; https://www.purebasic.fr/english/viewtopic.php?f=19&t=17427
Macro EndianSwap(Number)
CompilerSelect TypeOf(Number)
CompilerCase #PB_Word
EndianSwapW(Number)
; http://www.unrealtexture.com/Unreal/Downloads/3DEditing/UnrealEd/Tutorials/unrealwiki-offline/umod-file-format.html
#UMOD_DECALSTAY$ = "DecalStay.umod"
#UMOD_EXCESSIVE$ = "Excessive100.umod"
; .l type (4bytes)
#UMOD_MAGIC_NBR = $9FE3C5A3
;#UMOD_MAGIC_NBR = $A3C5E3FE
#UMOD_FILE_REGULAR = $00
@aziascreations
aziascreations / DecalStay.umod.b64
Created November 18, 2018 11:33
An Include that help you analyse ".umod" files and read it's content.
W1NldHVwXQ0KUHJvZHVjdD1EZWNhbCBTdGF5DQpWZXJzaW9uPTIwMA0KQXJjaGl2ZT1EZWNhbFN0YXkudW1vZA0KU3JjUGF0aD0uDQpNYXN0ZXJQYXRoPS4uDQpSZXF1aXJlcz1VbnJlYWxUb3VybmFtZW50NDAwUmVxdWlyZW1lbnQNCkdyb3VwPVNldHVwR3JvdXANCkdyb3VwPURlY2FsU3RheUdyb3VwDQpHcm91cD11bW9kSW5jbHVkZUZpbGVzR3JvdXANCg0KW1VucmVhbFRvdXJuYW1lbnQ0MDBSZXF1aXJlbWVudF0NClByb2R1Y3Q9VW5yZWFsVG91cm5hbWVudA0KVmVyc2lvbj00MDANCg0KW1NldHVwR3JvdXBdDQpDb3B5PShTcmM9U3lzdGVtXE1hbmlmZXN0LmluaSxNYXN0ZXI9U3lzdGVtXE1hbmlmZXN0LmluaSxTaXplPTQ3OSxGbGFncz0zKQ0KQ29weT0oU3JjPVN5c3RlbVxNYW5pZmVzdC5pbnQsTWFzdGVyPVN5c3RlbVxNYW5pZmVzdC5pbnQsU2l6ZT00NzgsRmxhZ3M9MykNCg0KW0RlY2FsU3RheUdyb3VwXQ0KRmlsZT0oU3JjPVN5c3RlbVxEZWNhbFN0YXkudSxTaXplPTMyMDQwKQ0KRmlsZT0oU3JjPVN5c3RlbVxEZWNhbFN0YXkuaW50LFNpemU9ODkpDQoNClt1bW9kSW5jbHVkZUZpbGVzR3JvdXBdDQpGaWxlPShTcmM9SGVscFxEZWNhbFN0YXkuaHRtLFNpemU9MjQ5OCkNCg0KW1NldHVwXQ0KTG9jYWxQcm9kdWN0PURlY2FsIFN0YXkNClJlYWRNZT1IZWxwXERlY2FsU3RheS5odG0NClNldHVwV2luZG93VGl0bGU9RGVjYWwgU3RheQ0KQXV0b3BsYXlXaW5kb3dUaXRsZT1EZWNhbCBTdGF5IE9wdGlvbnMNClByb2R1Y3RVUkw9aHR0cDovL3d3
@aziascreations
aziascreations / UTPackageVersion.pbi
Created November 10, 2018 01:04
A basic procedure to check Unreal Engine package's version in PureBasic
; As described in:
; http://eliotvu.com/page/unreal-package-file-format
Enumeration UnrealEngineVersion
; U and U2 are also missing (U could be 69 since it's the same engine ?)
#UE_UT99 = 69
; UT2003 is missing from the docs :/
#UE_UT_UT2004 = 128
#UE_UT_UT3 = 512
OpenConsole()
Procedure CRC16CCITT(*mem.Ascii,len)
Protected crc.u = $FFFF;
While a < len
For i = 0 To 7
bit = (*mem\a >> (7-i) & 1)
c15 = ((crc >> 15) & 1)
crc << 1
If Bool(c15 ! bit)
@aziascreations
aziascreations / up.bat
Created August 17, 2017 10:35
Simple script that lets go back in the current path easily
@echo off
if "%1"=="" (echo Error: No arguments passed ! && exit /B)
set "var="&for /f "delims=0123456789" %%i in ("%1") do set var=%%i
if defined var (echo Error: Non-numeric value passed ! && exit /B)
for /l %%x in (1, 1, %1) do cd ..