This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_name Promise extends RefCounted | |
# Constants | |
const State = { | |
PENDING = "pending", | |
FULFILLED = "fulfilled", | |
REJECTED = "rejected" | |
} | |
# Signals |
NewerOlder