Skip to content

Instantly share code, notes, and snippets.

View Jaezmien's full-sized avatar
🐄
Moo!

Jaezmien Naejara Jaezmien

🐄
Moo!
View GitHub Profile
@Jaezmien
Jaezmien / class.lua
Last active January 22, 2021 14:22
Class handler for Lua >= 5.0
-- class.lua
-- By: Jaezmien Naejara
local clone
do
clone = function (orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
@Jaezmien
Jaezmien / pauser.ts
Created February 4, 2021 11:04
Pause async thread and continue using a separate thread
export default class Pauser {
private paused: boolean = false;
private resolve: any = undefined;
Pause() {
if( this.paused ) return;
this.paused = true;
return new Promise((res) => { this.resolve = res; });
}
@Jaezmien
Jaezmien / notitg-addresses.yml
Last active October 14, 2022 08:17
NotITG Addresses in YAML format
V1:
BuildAddress: 0x006AED20
Address: 0x00896950
BuildDate: 20161224
Size: 10
V2:
BuildAddress: 0x006B7D40
Address: 0x008A0880
BuildDate: 20170405
Size: 10
@Jaezmien
Jaezmien / exec.js
Last active May 2, 2021 10:19
👂 Execute and listen the console.log of a code
function exec_js(code) {
var _log = console.log;
var logs = [];
console.log = function(...value) {
_log.apply(console, arguments);
logs.push( value );
}
Function( code )();
console.log = _log;
return logs;
@Jaezmien
Jaezmien / debounce.js
Last active July 25, 2021 03:14
⏱ Small debounce function
const debounce = function(f, t) {
let id;
return function() {
if( id ) clearTimeout(id);
id = setTimeout(() => {id = null; f()}, t);
}
}
@Jaezmien
Jaezmien / TinyBlockPos.cs
Last active January 7, 2023 03:40
Tiny version of BlockPos.jar from Minecraft for handling different formats (Vector3 & Long)
using System.Numerics;
namespace Minecraft
{
class TinyBlockPos
{
private static long X_MASK = (1L << 26) - 1L;
private static long Y_MASK = (1L << 12) - 1L;
private static long Z_MASK = (1L << 26) - 1L;
private Vector3 position;
@Jaezmien
Jaezmien / char_states.lua
Created January 9, 2022 03:12
NotITG Guide for BitmapText Character States
return {
-- + Special Characters (1)
[' '] = 0,
['space'] = 0,
['!'] = 1,
['&quot;'] = 2,
['"'] = 2,
['#'] = 3,
['$'] = 4,
['%'] = 5,
@Jaezmien
Jaezmien / exportms3d279.py
Last active January 28, 2022 08:04
Blender Addon to objects to Milkshape 3D ASCII format
# *heavily* based on blender's export_obj.py addon + obvr's obj2ms3dascii
# for use with Blender 2.7x and below
import bpy
import os
import shutil
import mathutils
from bpy_extras import io_utils
from bpy_extras.io_utils import ExportHelper, path_reference_mode, axis_conversion, orientation_helper_factory
from bpy.props import StringProperty, BoolProperty, FloatProperty
@Jaezmien
Jaezmien / TEMPLATE.md
Created February 21, 2022 00:02
README Template

Project Name

Short description

@Jaezmien
Jaezmien / ytmp3.bat
Last active August 20, 2023 10:01
Quick lazy script to download youtube videos as mp3 using yt-dlp
@echo off
rem ; Set environment to local so that we don't leak variables
setlocal
set ytid=%1
IF "%ytid:~0,24%"=="https://www.youtube.com/" goto warning-link
IF "%ytid:~0,23%"=="http://www.youtube.com/" goto warning-link
IF "%ytid:~0,20%"=="https://youtube.com/" goto warning-link