Skip to content

Instantly share code, notes, and snippets.

View VapidLinus's full-sized avatar

Linus VapidLinus

View GitHub Profile
// ==UserScript==
// @name Kagi Assistant Collapsible Models
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Makes model sections in Kagi Assistant collapsible and saves their state.
// @author Gemini 2.5 Pro
// @match https://kagi.com/assistant*
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
@VapidLinus
VapidLinus / kaaut.js
Last active August 2, 2025 10:08
A collapsible, auto-refreshing, theme-integrated usage widget for Kagi Assistant.
// ==UserScript==
// @name Kagi Assistant AI Usage Tracker
// @namespace http://tampermonkey.net/
// @version 14.0
// @description A collapsible, auto-refreshing, theme-integrated usage widget for Kagi Assistant.
// @author Gemini 2.5 Pro & VapidLinus
// @match https://kagi.com/assistant*
// @connect kagi.com
// @grant GM.xmlHttpRequest
// @grant GM_setValue
@VapidLinus
VapidLinus / TransmitAudioData.cs
Last active January 28, 2024 11:08
Transcode single-channel PCM audio data to dual-channel and output it to D#+'s voice sink
private static async Task TransmitAudioData(byte[] audioData, VoiceTransmitSink sink)
{
var startInfo = new ProcessStartInfo("ffmpeg")
{
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
Arguments = string.Join(" ", [
"-loglevel panic",
@VapidLinus
VapidLinus / cozy-kagi-theme.css
Last active January 20, 2024 14:14 — forked from jamesjlyons/cozy-kagi-theme.css
A fix for jamesjlyons's cozy theme for Kagi Search. This version respects Kagi's dark mode setting. Be sure to set the default Kagi themes to "Calm Blue" and "Moon Dark" for the themes to apply properly.
:root {
--background-color: var(--sand2);
--color-primary: var(--sand12);
--search-result-title: var(--color-primary);
--search-result-title-hover: var(--color-primary);
--result-item-title-border_hover: var(--color-primary);
--domain-rank-icon-color-normal: var(--sand7);
--search-result-date-bg: var(--sand3);
--search-result-content-text: var(--sand11);
--inline-domain-tag-bg: var(--sand3);
@VapidLinus
VapidLinus / Welcome.md
Last active August 28, 2021 11:44
You have been logged in
using UnityEngine.UI;
[RequireComponent(typeof(RectTransform), typeof(LayoutElement))]
[ExecuteInEditMode]
public class LayoutElementFitParent : MonoBehaviour
{
[SerializeField] private float aspectRatio = 1;
[SerializeField] private bool updateMin = false;
[SerializeField] private bool updatePreferred = false;
using System;
using UnityEngine;
public abstract class BaseBehaviour : MonoBehaviour
{
public T RequireComponent<T>(Action<T> a) where T : Component
{
T component = gameObject.GetComponent<T>();
if (component == null)
{
package net.uniqraft.api;
public final class StringTools {
public static String replaceAll(String text, String replace, String replacement) {
if (replace == replacement)
return text;
String currentText = null;
String newText = text;
do {