Skip to content

Instantly share code, notes, and snippets.

@apkd
apkd / SquirrelNoise5.cs
Last active May 14, 2023 20:57
SquirrelNoise5 - Squirrel's Raw Noise utilities (version 5), ported to C#. http://tryfinally.dev/squirrel-noise-5-ported-to-csharp
// ReSharper disable MemberHidesStaticFromOuterClass
/// <summary>
/// SquirrelNoise5 - Squirrel's Raw Noise utilities (version 5)
///
/// This code is made available under the Creative Commons attribution 3.0 license (CC-BY-3.0 US):
/// Attribution in source code comments (even closed-source/commercial code) is sufficient.
/// License summary and text available at: https://creativecommons.org/licenses/by/3.0/us/
///
/// These noise functions were written by Squirrel Eiserloh as a cheap and simple substitute for
@apkd
apkd / widegpt.css
Last active May 21, 2023 13:41
WideGPT: Simply makes your ChatGPT conversations wider. Convenient if you're using a computer monitor produced after 1999.
/* ==UserStyle==
@name WideGPT
@version 0.1
@namespace https://tryfinally.dev/
@description Simply makes your ChatGPT conversations wider. Convenient if you're using a computer monitor produced after 1999.
@author tryfinally.dev
==/UserStyle== */
@-moz-document domain("chat.openai.com") {
.xl\:max-w-3xl { max-width: 90% !important; }
@apkd
apkd / reencode.bat
Last active August 9, 2022 11:47
Quickly re-encodes a video file to .mp4. Add it to your PATH (along with ffmpeg).
@echo off
IF "%1"=="" (
echo Usage: reencode path_to_file [optional_crf]
goto eof
)
SET crf="23"
IF NOT "%2"=="" (
SET crf=%2
@apkd
apkd / 1-medicine-before.cs
Last active April 4, 2024 09:36
Medicine IL post-processing comparison
using UnityEngine;
using Medicine;
class Player : MonoBehaviour
{
[Inject.Single]
LevelManager levelManager { get; }
[Inject.Single]
Camera mainCamera { get; }
using System.Diagnostics.CodeAnalysis;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering
{
public sealed class BatchingInfo : MonoBehaviour
{
public bool Enable = true;
const float AverageStatDuration = 1.0f; // stats refresh each second
@apkd
apkd / settings.json
Created September 30, 2019 12:48
vscode settings
{
"workbench.colorTheme": "Shape",
"workbench.settings.editor": "json",
"workbench.settings.useSplitJSON": true,
"editor.fontFamily": "Monoid",
"editor.fontSize": 13,
"editor.cursorStyle": "block",
"editor.accessibilitySupport": "off",
"editor.codeLens": false,
"csharp.referencesCodeLens.enabled": false,
using System.Collections.Generic;
using UnityEngine;
namespace Apkd
{
namespace Internal
{
sealed class MaterialPropertiesPreserver : MonoBehaviour
{
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Reflection;
namespace CommunityCoreLibrary
{
public static class Detours
{
/*
*
* Push Notifications codelab
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
@apkd
apkd / download-video.ps1
Last active October 22, 2017 21:12
Powershell/batch script to download video using StreamLink (takes link from clipboard)
add-type -as System.Windows.Forms;
$url = [windows.forms.clipboard]::GetText()
$arr = $url.split("/")
$arr = $arr[$arr.length - 1].split("=")
$filename = $arr[$arr.length - 1]
echo $filename
&"streamlink" $url "best" "--out" "$($filename).mp4"