Skip to content

Instantly share code, notes, and snippets.

View Kas-tle's full-sized avatar
💭
Working on it...

Kas-tle

💭
Working on it...
  • Oakland
View GitHub Profile
plugins {
id("eclipse")
}
eclipse {
classpath {
file {
withXml {
val classpath = asNode()
val compositeBuildModuleNames = mutableSetOf<String>()
$playlist = Read-Host -Prompt "Enter playlist"
if (-not (Test-Path 'songs')) {
New-Item -Path 'songs' -ItemType Directory | Out-Null
}
# Download all songs
yt-dlp --ignore-errors --extract-audio --audio-format vorbis --audio-quality 5 --output "songs/%(video_autonumber)03d.%(ext)s" --yes-playlist "$playlist"
# Loop through each .ogg file in the directory
@Kas-tle
Kas-tle / otp.json
Last active April 30, 2023 18:33
UNIX OTP Tool
[
{
"account": "My first account email@email.com",
"key": "8SDFYSDNFSDFY89SDFSDF"
},
{
"account": "My second account email@email.com",
"key": "23849HFGDKLDFIAE"
}
]
!SESSION 2023-01-26 21:59:21.890 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Command-line arguments: -data /home/jdcastle/.vscode-server/data/User/workspaceStorage/5776ca54e095392d79f65f6d699c53c6/redhat.java/jdt_ws
!ENTRY org.eclipse.jdt.ls.core 1 0 2023-01-26 21:59:23.193
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started
@Kas-tle
Kas-tle / outline.md
Last active February 16, 2023 05:20
Scraping an Enjin Site via the Enjin API

Scraping an Enjin Site via the Enjin API

Authentication

Obtain a Session ID

First, you must obtain a Session ID. This can be done by logging in to the site with email and password. The Session ID is contained in the session_id field of the response. The session_id field is contained in the result object.

Request

@Kas-tle
Kas-tle / extract-heads.sh
Last active January 22, 2023 02:45
Extract tile heads from a minecraft world
# Depends on:
# sudo apt install libjson-perl
# sudo apt install libcompress-raw-zlib-perl
if [[ ! -d world ]]; then
tar -xf ${1} world
fi
if [[ ! -d run ]]; then
git clone https://github.com/MirrgieRiana/nbt_to_json_perl.git run
@Kas-tle
Kas-tle / replace_heads.sh
Last active July 31, 2022 11:45
Replace heads in world and generate resource pack
# sudo mca2nbt *.mca
# rm *.mca
# sudo chown -R jdcastle:jdcastle *
# sudo chmod 775 *
mkdir -p scratch
mkdir -p target/rp
mkdir -p target/datapack/replace_heads/data/replace_heads/functions/replacements
mkdir -p target/animatronics
mkdir -p target/shops
unzip rp.zip -d target/rp
@Kas-tle
Kas-tle / mappings.json
Last active July 28, 2022 21:07
Slimefun Item Mappings
{
"PORTABLE_DUSTBIN": {
"type": "HeadTexture",
"slimefun_item": "PORTABLE_DUSTBIN",
"head_enum": "TRASH_CAN",
"head_texture": "32d41042ce99147cc38cac9e46741576e7ee791283e6fac8d3292cae2935f1f",
"category": "usefulItems"
},
"ENDER_BACKPACK": {
"type": "HeadTexture",
@Kas-tle
Kas-tle / path_cleaner.jq
Created July 27, 2022 16:36
Clean path for model
def cleanpath(inp):
inp
| split("/")
| del(.[0:2], .[3])
| .[-1] = (.[-1] | split(".") | del(.[-1]) | reduce .[] as $item (""; . + ($item) + ".") | .[:-1])
| reduce .[] as $item (""; . + ($item) + "/")
| .[:-1]
;
cleanpath(.)
@Kas-tle
Kas-tle / atlas_group.jq
Last active July 26, 2022 05:39
JQ Texture Atlas Grouper
def intersects(a;b): any(a[]; . as $x | any(b[]; . == $x));
def mapatlas(set):
(set | unique) as $unique_set
| (map(if intersects(.; $unique_set) then . else empty end) | add + $unique_set | unique) as $new_set
| map(if intersects(.; $new_set) then empty else . end) + [$new_set];
reduce .[] as $entry ([]; mapatlas($entry))
# | to_entries | .[]? | select(any(.value[]; . == "red")) | .key