Skip to content

Instantly share code, notes, and snippets.

View TheEpicBlock's full-sized avatar

TheEpicBlock

View GitHub Profile
@TheEpicBlock
TheEpicBlock / LinkedMap.ts
Created January 5, 2025 18:57
Linked map with ability to insert anywhere
class CustomMap<K, V> implements Iterable<V> {
private map: Map<K, LinkedNode<V>>;
// The first element of the linked list
private first: LinkedNode<V> | null;
// Represents the last element (in order)
// this field will null if and only if `first` is null
private last: LinkedNode<V> | null;
constructor() {
this.map = new Map();
#!/usr/bin/env bash
# Lists all sha1 hashes of a packwiz pack. Requires internet
# Usage ./packwiz_hashes <pack>
cd $1
# Curseforge is mostly already in sha1
grep -l "mode = \"metadata:curseforge\"" -r **/*.pw.toml | xargs -I %s grep "hash =" %s | cut -d '"' -f2 | cut -d '"' -f1
# Convert urls to sha1
grep "url =" -r **/*.pw.toml | cut -d '"' -f2 | cut -d '"' -f1 | xargs -I %s bash -c "curl -sL \"%s\" | sha1sum" | cut -d " " -f1
# Grab all loose jars