Skip to content

Instantly share code, notes, and snippets.

View mr5z's full-sized avatar
🎯
Focusing

mark mr5z

🎯
Focusing
View GitHub Profile
@mr5z
mr5z / GetTokenResponse.cs
Created February 17, 2024 17:38
Android.Maui - Seriously?
public async Task<TokenResponse> GetTokenResponse()
{
var raw = Task.Run(async () => await SecureStorage.GetAsync(KeyTokenResponse)).Result
?? throw new InvalidOperationException($"'{nameof(TokenResponse)}' not found");
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(raw), false);
return await JsonSerializer.DeserializeAsync<TokenResponse>(stream)
?? throw new InvalidOperationException($"Cannot deserialize '{nameof(TokenResponse)}'");
}
@mr5z
mr5z / IDrawableWorkaround.cs
Created January 5, 2025 08:13
Workaround since binding doesn't work yet on IDrawable/GraphicsView
internal class CustomGraphicsView : GraphicsView
{
// TODO workaround since binding doesn't work yet on IDrawable/GraphicsView
// https://github.com/dotnet/maui/issues/20991
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
if (BindingContext is not null)
{
@mr5z
mr5z / twitch-emote.js
Last active April 20, 2025 21:01
Improvised Twitch emotes
(function() {
const emoteMap = {
"monke": "πŸ’",
"pog": "😲",
"pepega": "🧠❌",
"sadge": "😒",
"OMEGALUL": "🀣",
"KEKW": "πŸ˜‚",
"PeepoHappy": "😊",
"FeelsStrongMan": "πŸ’ͺ",