Skip to content

Instantly share code, notes, and snippets.

View Lachee's full-sized avatar
📖
xkcd.com/1421/

Lake Lachee

📖
xkcd.com/1421/
View GitHub Profile
@Lachee
Lachee / Example.cs
Last active April 15, 2025 11:16
Gets the available streams from Twitch. Useful for plugging into services such as ffmpeg.
// Starts a restream at 480p
async Task RestreamLowQuality(string channelName) {
var availableStreams = await Sniffer.GetStreamsAsync(channelName); // Fetch all the available streams
var stream = availableStreams.Where(s => s.QualityNo == 480).FirstOrDefault(); // Get just the 480, otherwise the best we can.
return BeginRestream(stream.Url); // Pass it to FFMPEG to restream it
}
// Starts FFMPEG to restream the url. This avoids SSL issues with OpenCV
private Process BeginRestream(string url, bool sync = false, bool verbose = false)
{
@Lachee
Lachee / EOLConversion.cs
Last active August 26, 2021 12:17
Utility Script to create EOL Conversions.
// Author: Lachee
// License: Public Domain - Do what you want with it
// Note: Script to convert line endings in unity so you dont get those annoying warnings.
// Simply put this script in a folder called Editor, then go Tools -> EOL Conversion -> Windows/Unix
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEditor;
@Lachee
Lachee / Example.cs
Created September 2, 2021 23:16
Singleton class
public class Level : Singleton<Level>
{
public void DoStuff();
}
void OtherAccess() {
Level.instance.DoStuff();
}
@Lachee
Lachee / UUID.php
Last active November 5, 2021 02:33
Packs / Unpacks a integer ID into a pseudo faux UUID's with signature to verify origins. Formatting is customisable.
<?php
// Required if you are putting in a namespace:
// namespace app\helpers;
// use InvalidArgumentException;
/**
* Packs / Unpacks a integer ID into a pseudo faux UUID's ( 8-8-12 ) with signature to verify origins.
* Not secure, but provides an abstraction layer to hide the true nature of your database.
*
@Lachee
Lachee / PrivateAvatar.cs
Last active February 24, 2022 06:15
Enforces Avatar Privating
/**
* This avatar has been marked as private. As per the licensing agreement when downloading this model,
* you are not allowed to share it.
*
* This script automatically disables the share button in VRChat when publishing to help enforce this rule.
*
* Script Author: Lachee
* Installation: Include this script in any folder called Editor.
* For additional safety, also include the PrivateAvatarBehaviour and uncomment the configuration
*
@Lachee
Lachee / AutoAttribute.cs
Created May 5, 2022 10:19
The [Auto] will automatically link components to the script
using UnityEngine;
namespace Lachee.Utilities
{
/// <summary>
/// Automatically fetches attached components
/// </summary>
[System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = false)]
public class AutoAttribute : PropertyAttribute
{
@Lachee
Lachee / pride.scss
Last active December 19, 2023 18:39
SASS Mixin for Pride Flags
// Pride Flag Mixin
// Author: Lachee
// License: MIT (do what you want)
@mixin pride-background {
&.lgbt {
background: linear-gradient(180deg, #FE0000 16.66%, #FD8C00 16.66%, 33.32%, #FFE500 33.32%, 49.98%, #119F0B 49.98%, 66.64%, #0644B3 66.64%, 83.3%, #C22EDC 83.3%);
}
&.asexual {
background: linear-gradient(180deg, #181818 25%, #A3A3A3 25%, 50%, #FFFFFF 50%, 75%, #800080 75%);
}
@Lachee
Lachee / Polyfil.ts
Last active December 11, 2022 17:33
Svelte CloudFlare Polyfil
/**
This polyfil solves some of the issues svelte's cloudflare adapter has with goto and localStorage being.... iffy.
This will polyfil the goto as a stub for SSR and polyfil the localStorage as a simple array storage.
Feel free to implement your own polyfils for localStorage to actually be useful too, i only request you share it forwards.
Author: Lachee
License: MIT (do what you want)
Date: 12/12/2022
*/
@Lachee
Lachee / gshade_to_reshade_guide.md
Created February 7, 2023 13:03 — forked from snightshade/gshade_to_reshade_guide.md
GShade -> ReShade migration guide for FFXIV

How To Move To ReShade From GShade

(a guide by rika (@lostkagamine). tested, should work fine.)

(Korean version / 한국어 버전)

If you are having issues like the screen turning black, read the mini-FAQ at the bottom of this document!

0. Don't uninstall GShade yet!

Uninstalling GShade removes the gshade-shaders folder which contains all the content. It does not remove GShade's executable file. This guide will help you do that.
If you already uninstalled it, reinstall it. Sounds weird, I know, but just don't open the game.

@Lachee
Lachee / OpenTTS.html
Last active May 9, 2023 06:03
Converts your speech into text, and then into speech again in mostly real time using the Web Speech API. (CHROME ONLY)
<html>
<head>
<style>
* { font-family: Arial, Helvetica, sans-serif;}
div {
background: #00000008;
margin: 10px;
min-height: 1em;