Skip to content

Instantly share code, notes, and snippets.

View teneko's full-sized avatar

Teneko teneko

View GitHub Profile
{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 5.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -100.0,
"hpf-frequency": 10.0,
@dfederm
dfederm / AsyncMutex.cs
Created November 3, 2022 06:44
AsyncMutex
public sealed class AsyncMutex : IAsyncDisposable
{
private readonly string _name;
private Task? _mutexTask;
private ManualResetEventSlim? _releaseEvent;
private CancellationTokenSource? _cancellationTokenSource;
public AsyncMutex(string name)
{
_name = name;
namespace System.Diagnostics.CodeAnalysis {
// Input: field, property, argument
// Output: field, property, argument, result
// AllowNull - Null input is allowed
// DisallowNull - Null input is disallowed
// MaybeNull - Output may be null
// MaybeNull/When - Output may be null (when result == true/false)
@dem1995
dem1995 / sd_video_ids_with_labels.txt
Created July 20, 2020 03:56
SupraDarky Channel Video IDs and Titles
6MQRL7xws7w - Best VGM 01 - Wild Arms - Town Theme
P8oefrmJrWk - Best VGM 02 - Metroid Prime - Ice Valley (Phendrana Deep Lake)
Y5HHYuQi7cQ - Best VGM 03 - Castlevania : Curse of Darkness - Garibaldi Courtyard
GBYsdw4Vwx8 - Best VGM 05 - Silent Hill 2 - Theme of Laura
iSP-_hNQyYs - Best VGM 06 - Chrono Trigger - Undersea Palace
AvlfNZ685B8 - Best VGM 07 - Chaos Legion - Feel No Fear (Sky Gallery)
AGWVzDhDHMc - Best VGM 08 - Shadow Hearts II : Covenant - Astaroth (Fallen Angel Battle)
DlcwDU0i6Mw - Best VGM 09 - Tribes 2 - Desert
jChHVPyd4-Y - Best VGM 11 - Zelda : Ocarina of Time - Song of Storms (Windmill Hut)
e9xHOWHjYKc - Best VGM 12 - Beyond Good & Evil - Home Sweet Home
@lordlycastle
lordlycastle / update_refs failed.sh
Last active September 27, 2024 15:51
When you get update_ref failed for ref error in git.
# Rename from 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main.lock' to 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main' failed. Should I try again? (y/n) n
# error: update_ref failed for ref 'refs/remotes/origin/CHA/main': couldn't set 'refs/remotes/origin/CHA/main'
$ cd $(git rev-parse --show-toplevel) # if necessary
$ rm -rf .git/refs/remotes/origin # remove all origin/*
$ mkdir .git/refs/remotes/origin # create empty origin/
$ git fetch origin # repopulate origin/*
@vtenq
vtenq / git-workflow.md
Last active September 2, 2024 16:54
Git workflow with conventional commits and semantic auto release

Git workflow with conventional commits and semantic auto release

This is an adoptation of Git flow by Vincent Driessen with conventional commits and semantic release.

The main concepts

At the core, the development model is greatly inspired by existing models out there. The central repo holds two main branches with an infinite lifetime:

@SteveSandersonMS
SteveSandersonMS / blazor-auth.md
Created June 11, 2019 10:49
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@SteveSandersonMS
SteveSandersonMS / sequence-number.md
Last active August 14, 2024 06:11
Why sequence numbers should relate to code line numbers, not execution order

Why sequence numbers should relate to code line numbers, not execution order

Or in other words, why you should hard-code sequence numbers, and not generate them programmatically.

Unlike .jsx files, .razor/.cshtml files are always compiled. This is potentially a great advantage for .razor, because we can use the compile step to inject information that makes things better or faster at runtime.

A key example of this are sequence numbers. These indicate to the runtime which outputs came from which distinct and ordered lines of code. The runtime uses this information to generate efficient tree diffs in linear time, which is far faster than is normally possible for a general tree diff algorithm.

Example

<!--Works-->
<Image Source="resm:CrossTestAppAvalonia.Images.info2_blue.png" Width="32" Height="32" Margin="5"/>
<!--Works-->
<Image Source="resm:CrossTestAppAvalonia.Images.warning2_yellow.png" Width="32" Height="32" Margin="5"/>
<!--Works-->
<TextBox Name="textbox" Margin="5">
<i:Interaction.Behaviors>
<ia:DataTriggerBehavior Binding="{Binding MyProperty.Boolean}" ComparisonCondition="Equal" Value="true">
<ia:ChangePropertyAction TargetObject="{Binding #textbox}" PropertyName="Text" Value="info2_blue.png" />
@LGM-AdrianHum
LGM-AdrianHum / JunctionPoint.cs
Last active April 16, 2023 18:27
Create, Delete and Examine Junction Points in C#
// File: RollThroughLibrary/CreateMaps/JunctionPoint.cs
// User: Adrian Hum/
//
// Created: 2017-11-19 2:46 PM
// Modified: 2017-11-19 6:10 PM
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;