Skip to content

Instantly share code, notes, and snippets.

View scarletquasar's full-sized avatar
:electron:
I may be slow to respond.

Scarlet Rose scarletquasar

:electron:
I may be slow to respond.
View GitHub Profile
class Either<TLeft, TRight> {
protected leftValue: TLeft = null;
protected rightValue: TRight = null;
static left<T>(value: T) {
const either = new Either<T, any>();
either.leftValue = value;
return either;
}
@scarletquasar
scarletquasar / sortedWords.ts
Created October 4, 2023 19:18
sorted words
const words = ["cat", "act", "tac", "art", "tar"];
const expectedOutput = {
"act": ["cat", "act", "tac"],
"atr": ["art", "tar"],
}
const sortedWords = words
.map(word => word.split(''))
.map(array => array.sort())
@scarletquasar
scarletquasar / accentsAutohotkey.md
Created February 19, 2024 05:21
[Script] Accents in american keyboard using Autohotkey
Combinations Alt Alt + Ctrl Alt + Shift Alt + Shift + Ctrl Right Alt
A á à Á À ã
E é è É È
I í ì Í Ì
O ó ò Ó Ò õ
U ú ù Ú Ù
@scarletquasar
scarletquasar / RecurrentDateTimeOffset.cs
Created October 20, 2024 01:51
RecurrentDateTimeOffset Draft
namespace FitLivre.DataStructures
{
public class RecurrentDateTimeOffset
{
private readonly RecurrentDateTimeKind _recurrencyKind;
private readonly DateTimeOffset[]? _fixedFiniteOccurrences;
private readonly RecurrentWeekDayAndTime[]? _perWeekOccurrences;
private readonly RecurrentMonthDayAndTime[]? _perMonthOccurrences;
private readonly RecurrentYearMonthDayAndTime[]? _perYearOccurrences;
private readonly TimeSpan _tolerance;