Skip to content

Instantly share code, notes, and snippets.

View mfdeveloper's full-sized avatar
🕹️
Creating games and mobile apps, every day!

Felipe Michel mfdeveloper

🕹️
Creating games and mobile apps, every day!
View GitHub Profile
@mfdeveloper
mfdeveloper / TaskCompletionSourceDictionary.cs
Created October 27, 2023 19:50 — forked from GeorgeTsiokos/TaskCompletionSourceDictionary.cs
TaskCompletionSourceDictionary - key is generic, value can be any result, with runtime type check to ensure producer and consumer type parity
[DebuggerDisplay("Count = {" + nameof(Count) + "}")]
public sealed class TaskCompletionSourceDictionary
{
private readonly TaskCompletionSourceDictionary<Type> _dictionary = new TaskCompletionSourceDictionary<Type>();
public int Count => _dictionary.Count;
public bool TryGetValue<T>(out TaskCompletionSource<T> taskCompletionSource) =>
_dictionary.TryGetValue(typeof(T), out taskCompletionSource);
@mfdeveloper
mfdeveloper / CancelListener.kt
Last active January 30, 2023 15:53 — forked from kasparsj/CountUpTimer.java
Java pooling: An infinite timer
package com.example.services.timers.listeners
/**
* Functional interface to allow use SOLID [Interface segregation principle](https://en.wikipedia.org/wiki/Interface_segregation_principle)
* from any Java class
*/
fun interface CancelListener {
/**
* "Event" triggered when [android.os.CountDownTimer.cancel] is called
*/
@mfdeveloper
mfdeveloper / .gitignore
Last active May 1, 2021 18:41 — forked from Matheus-Felipe-C/lista de 50 questoes.c
Project for 50 question list resolution with a menu to navigate in between them
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output