Skip to content

Instantly share code, notes, and snippets.

View knzai's full-sized avatar

Kenzi Connor knzai

View GitHub Profile
@knzai
knzai / template.rb
Last active August 19, 2024 19:49
Basic template for using ruby for a shell script with color - zero external dependencies
#!/usr/bin/env ruby
# frozen_string_literal: true
#============================
# REQUIRES/DEPS
#============================
require 'optparse'
#============================
# CONSTANTS & DEFAULTS
@knzai
knzai / file_byte_reader.js
Last active August 10, 2024 18:47
WebComponent for simpler parsing of a file selector input into a bytearray (like to use in wasm file processing)
//attach a listener (to an `is` applied file selector) that will get the parsed byte array to use:
//<input is="file-byte-reader" id="file-input"
//$('#file-input').addEventListener("file-byte-reader:loaded", e => YOURHANDLER(e.detail));
class FileByteReader extends HTMLInputElement {
connectedCallback() {
this.type = "file";
this.addEventListener('change', this.onChange);
}
emit (type, detail = {}) {
@knzai
knzai / notes.rs
Last active July 25, 2024 05:42
Things I still need reminders on when implementing models around Options etc
//take
OPTION.take() == mem::replace(OPTION, None)
//map
if let Some(value) = OPTION { *value = 42; } == OPTION.map(|value| *value = 36);
//Drop for boxed recursive options
impl Drop for Class {
fn drop(&mut self) {
let mut current = class_ref.take();
@knzai
knzai / template.sh
Created July 23, 2024 21:00
My minimal starting template for bash - short and long params, colored output, usage and version, license, etc
#!/usr/bin/env bash
set -Eeo pipefail
#============================
# CONSTANTS & DEFAULTS
#============================
#constants
readonly VERSION_NUM='0.1.0'
readonly SCRIPT='example.sh'
#in case terminal doesn't support colors - readonly after setup_colors runs
@knzai
knzai / ggdrive.sh
Last active July 15, 2024 18:42
curlable bash script to grab google drive file exports from their api, eg grabbing pdfs of gdocs
#!/usr/bin/env bash
set -Eeo pipefail
#============================
# CONSTANTS & DEFAULTS
#============================
#constants
readonly VERSION_NUM='1.2.0'
readonly SCRIPT='ggdrive.sh'
#in case terminal doesn't support colors - readonly after setup_colors runs
@knzai
knzai / - KNZ Drone Utilities.msch
Last active February 22, 2022 02:48
Mining and logistics utilities for the game Mindustry
bXNjaAF4nI17BzyV7f+/PQ7n2Du5rbJ3VpSVvYkk1cHBCedwhlFEESF7RMuOklBEpSQkVCRUqGSlrEhKov89tJ7n+X1ff72e8z7Xue9rfa7P/lwPDQeNCD0NAwEbiKORsrLdC5iQiAQcYIMn4Am+wBbAmuiLJ1PwXmTAyYuED6KQadi8cWT4K55IoOU3JgYF4Ui6gLOqojpgSKUQA/EEHImsBDjjKVgCnhqouzGi3g7AmEjCARaBQUQSRXlXGARKgH0AlkzRBUwDsL6+OJIC+A6VQIG+OOLIOAqgCFDJOG/AMxygbIwHjuxHJMEDO+K8iCRvQFMD8CKCX8gA1otEJJOBQGwQOLAflozTBexJeAIFwAKBuEAvXECAEgCY4ghe4JB4AuDlRyX4AzKhykQgFBsQQJYF8GRAFSB7+eHAaazBjQBEH7AnmYz1xZGBUDzFD/DGUbD4AHAqAjQEmUKiekGEIAMgFQAyDm4oATRMAVhPXACZRtY9ACSgl8J8/g2FEC0Fb4gUCgE/aQr+XKMQCJPag42GIwiiBbxJRWg9NOife0aazBsroeEIxIMbVQwiEb3AX4gkGiYyuDYvPxoOPCEER6LgvBXBX0Eqgg8QZAO3TySFK0IkoGGnIARERmXzgk8QaaCCIKoh32lo5Wl+/9EiQIcAPQIMCDAiwIQAMwIsCLAigEKADRmInYYOAjQCGAQ4EOBEgIuGHgJuBHgQ4EWADwF+BAQQEESGFkJA+Oea6SGgRVp00PppaegZaGk43D0DqDiPDbZz94CfMyCvMSLAhLzNDL4t5O5LwuEIHs4gXcIBGeVQgARxp+xGPxakAys0Gy0NCgN2jAo7d8J5iPDMgJN6jLmvSpsknWUifeKGXXaaAesuLscTWTu4FqtvbH2S8fnqSyvj9YRU74HXJYaJsfkhoZPn8tQF8nEvK3am6NX6saw8j59vcC0KCYsxK8ySim9eRuW88M3NN7MTQMVHOJQbdE25Z4oOcwhYxSkcsio5zXWzZfmyMXrzy5y0
@knzai
knzai / mindustry.udl.xml
Created February 14, 2022 00:56
Basic Notepadd++ syntax highlighting for Mindustry
<NotepadPlus>
<UserLang name="Mindustry" ext="mnd" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="yes" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments"></Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
---- Minecraft Crash Report ----
WARNING: coremods are present:
FMLPlugin (elulib-0.1.12.jar)
EnderCorePlugin (EnderCore-1.12.2-0.5.37.jar)
ForgelinPlugin (Forgelin-1.7.4.jar)
CTMCorePlugin (CTM-MC1.12.2-0.3.2.18.jar)
AstralCore (astralsorcery-1.12.2-1.9.4.jar)
LoadingPlugin (ResourceLoader-MC1.12.1-1.5.3.jar)
IELoadingPlugin (ImmersiveEngineering-core-0.12-85.jar)
[20:30:19] [main/ERROR]: Exception caught during firing event net.minecraftforge.client.event.RenderLivingEvent$Pre@426eb933:
java.lang.ClassCastException: net.minecraft.client.model.ModelPlayerVR cannot be cast to net.minecraft.client.model.ModelPlayer
at techguns.events.TGEventHandler.onRenderLivingEventPre(TGEventHandler.java:266) ~[TGEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_17_TGEventHandler_onRenderLivingEventPre_Pre.invoke(.dynamic) ~[?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
at Reflector.call(Reflector.java:997) [Reflector.class:?]
[19:55:16] [main/ERROR]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[19:55:16] [main/ERROR]: The following texture errors were found.
[19:55:16] [main/ERROR]: ==================================================
[19:55:16] [main/ERROR]: DOMAIN techguns
[19:55:16] [main/ERROR]: --------------------------------------------------
[19:55:16] [main/ERROR]: domain techguns is missing 22 textures
[19:55:16] [main/ERROR]: domain techguns has 1 location:
[19:55:16] [main/ERROR]: mod techguns resources at C:\Users\knzco\Documents\Curse\Minecraft\Instances\Techguns vr test\mods\techguns-1.12.2-2.0.1.1.jar
[19:55:16] [main/ERROR]: -------------------------
[19:55:16] [main/ERROR]: The missing resources for domain techguns are: