Skip to content

Instantly share code, notes, and snippets.

View YannickFricke's full-sized avatar
:octocat:
A ❤️ for open source

Yannick Fricke YannickFricke

:octocat:
A ❤️ for open source
View GitHub Profile
@YannickFricke
YannickFricke / snippets.json
Created November 17, 2025 21:07
My elixir VSCode snippets
{
"Inspect a value": {
"prefix": "ins",
"description": "Inspect a value with a label",
"body": [
"IO.inspect($1, label: \"$1\")"
]
},
"Pipe inspect": {
"prefix": "insp",
@YannickFricke
YannickFricke / test.ts
Created September 29, 2025 20:00
Yang first syntax idea
from "std/collections" import {List};
from "std/os" import {File};
export enum Result<SuccessType, ErrorType> {
Success(SuccessType),
Error(ErrorType),
}
export enum Maybe<T> {
Some(T),
defmodule MovEx.BufferedReader do
@moduledoc false
@enforce_keys ~w(source buffer chunk_size)a
defstruct ~w(source buffer chunk_size)a
@type t() :: %__MODULE__{
source: Stream.t(),
buffer: binary(),
@YannickFricke
YannickFricke / main.go
Created December 5, 2024 09:04
AoC 2024 Day 5
package main
import (
"fmt"
"math"
"os"
"slices"
"strconv"
"strings"
)
List<FoundMatch> findMatches(List<List<String>> lines, String wordToFind) {
final foundMatches = <FoundMatch>[];
for (var lineIndex = 0; lineIndex < lines.length; lineIndex++) {
final row = lines[lineIndex];
for (var columnIndex = 0; columnIndex < row.length; columnIndex++) {
final currentCharacter = lines[lineIndex][columnIndex];
if (currentCharacter != wordToFind[0]) {
@YannickFricke
YannickFricke / semantic_version.dart
Created November 17, 2024 09:40
Dart Semantic Version parser
final semanticVersionRegex = RegExp(
r'^'
r'(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)'
r'(?:-(?<preRelease>(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)))?'
r'(?:\+(?<build>(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)))?'
r'$',
);
/// Tries to parse the given [input] into a [SemanticVersion].
///
@YannickFricke
YannickFricke / elixir snippets.json
Created August 20, 2024 10:00
My VSCode Elixir snippets
{
"Inspect a value": {
"prefix": "ins",
"description": "Inspect a value with a label",
"body": [
"IO.inspect($1, label: \"$1\")"
]
},
"Pipe inspect": {
"prefix": "insp",
@YannickFricke
YannickFricke / utils.ex
Created July 18, 2024 15:29
Phoenix Utility methods
defmodule Utils do
@moduledoc """
## Usage
Could be imported in <project>/lib/my_app_web.ex for general access.
For example in controller/0
```elixir
import Utils
@YannickFricke
YannickFricke / twitch auth.ex
Created May 30, 2024 22:13
Twitch build authorization URL
@doc """
Builds an authorization URL which should be visited by users in order to connect Twitch to your application.
Reference: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#implicit-grant-flow
"""
@spec build_authorization_url(
client_id :: String.t(),
redirect_uri :: String.t(),
scopes :: list(Scope.t())
) :: String.t()
@YannickFricke
YannickFricke / flickering_effect.gd
Created May 24, 2024 14:20
Light2D flickering effect
extends Light2D
@export
var one_cycle_in_milliseconds = 1500
@export var min_alpha_number = 0
@export var max_alpha_number = 1
var intermediate_value = 0