Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name GitHub Tag Creator
// @namespace http://tampermonkey.net/
// @version 2.2
// @description Add ability to create tags on GitHub via API
// @author freehuntx
// @match https://github.com/*/*/tags*
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// @grant GM_getValue
@freehuntx
freehuntx / release.sh
Created July 8, 2025 16:25
Release workflow bash file
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Get the latest tag
LAST_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)"
# Get commits since the last tag, or all commits if no tag exists
if [[ -z "$LAST_TAG" ]]; then
COMMITS=$(git log --pretty=format:"%s")
@freehuntx
freehuntx / DataViewStream.js
Last active November 5, 2024 23:34
Buffer Serialization tools
class DataViewStream {
_grow = false
_byteOffset = 0
_view = null
_textDecoder = new TextDecoder()
_textEncoder = new TextEncoder()
get byteOffset() { return this._byteOffset }
get byteLength() { return this._view.byteLength }
get bytesLeft() { return this._view.byteLength - this._offset }
@freehuntx
freehuntx / _helpers.tpl
Created August 22, 2024 11:49
Helm - Templated values
{{- define "templated-values" -}}
{{- $filteredValues := dict -}}
{{- range $key, $val := $.Values }}
{{- $isSubchart := false -}}
{{- range $name, $subchart := $.Subcharts }}
{{- if eq $key $name }}
{{- $isSubchart = true -}}
{{- end -}}
{{- end -}}
{{- if not $isSubchart }}
@freehuntx
freehuntx / globalz.gd
Last active July 31, 2024 19:05
Godot globalz - Simple globals class
class_name Globalz
static var _globals := {}
static func write(key: String, value: Variant) -> void:
_globals[key] = value
static func read(key: String) -> Variant:
return _globals.get(key)
@freehuntx
freehuntx / kcpp_random_chat.js
Last active September 18, 2024 06:16
KoboldCpp random chat
const fetchRandomChar = async () => {
const corsPrefix = 'https://corsproxy.io/?'
const count = await fetch(corsPrefix + encodeURI('https://api.chub.ai/search?search=&first=1&page=1&nsfw=true'))
.then(res => res.json())
.then(res => res.data.count)
const randId = Math.floor(Math.random() * count)
const project = await fetch(corsPrefix + encodeURI(`https://api.chub.ai/search?search=&first=1&page=${randId}&nsfw=true`))
.then(res => res.json())
.then(res => res.data.nodes[0])
const character = await fetch(corsPrefix + encodeURI(`https://api.chub.ai/api/v4/projects/${project.id}/repository/files/raw%252Ftavern_raw.json/raw?ref=main&response_type=json`))
@freehuntx
freehuntx / tracker_client.gd
Last active February 6, 2024 14:38
Godot Webtorrent
extends RefCounted
## Classes/Constants
enum State { NEW, CLOSED, CONNECTING, CONNECTED }
class Response:
var info_hash: String # The info_hash which the repsonse belongs to
var peer_id: String # The peer_id of the other peer (who've sent it)
var offer_id: String # The offer_id that this offer/answer belongs to
var sdp: String # The sdp (webrtc session description) of the other peer
@freehuntx
freehuntx / godot_http.gd
Last active January 20, 2024 15:07
Godot HTTP
class_name Http extends RefCounted
class Response:
var code := -1
var headers := {}
var error := ""
var text := ""
var json = null
func _init(opts:={}):
for key in opts.keys():
@freehuntx
freehuntx / godot_eventemitter.gd
Last active December 22, 2023 16:04
Godot Eventemitter
class_name EventEmitter extends RefCounted
var _listeners := {} # Holds listener arrays
func emit(name: String, args:=[]):
if not name in _listeners: return # Skip if no listeners exist
_listeners[name] = _listeners[name].filter(func(e): return e.fn.get_object() != null) # Remove null instances
for e in _listeners[name]: # Iterate callbacks
e.fn.callv(args) # Call callback
_listeners[name] = _listeners[name].filter(func(e): return not e.once) # Remove "once" listeners
@freehuntx
freehuntx / godot_promise.gd
Last active December 1, 2023 21:58
Godot Promise
class_name Promise extends RefCounted
# Constants
const State = {
PENDING = "pending",
FULFILLED = "fulfilled",
REJECTED = "rejected"
}
# Signals