Skip to content

Instantly share code, notes, and snippets.

@mrange
mrange / BINGO1.md
Last active November 12, 2024 16:49
B I N G O
MAUI Enhancements .NET 9 Release Notes ASP.NET Core Updates Improved Performance Blazor WebAssembly
Hot Reload Microservices API Endpoints Machine Learning Cross-platform
Containerized ASP.NET Cloud-Native Microservices Minimal APIs Authentication/Identity
Multithreading ARM64 Support C# 13 Features AI and ML Integration JSON Serialization
WebAssembly Support Project Aspire OpenTelemetry Visual Studio Updates VB Compiler Updates
@mrange
mrange / BINGO.md
Last active November 8, 2024 20:40
Atari BINGO
B I N G O
Flickering Raster Bars Glitched Font BOMBS Mouse on Keyboard on
Medium Res Dithered Madness Full-Screen Fail Sound Fail 0bpl
No scrolltext Broken Lance Randomly Moving Pixels AtariForce! Ripped Mod
Screen Tear Central STOS No music Readable scroll VU METERS
Out of Sync Music Unreadable scroll Ripped Font Unreadable Graphical Overlay Ripped Code
@mrange
mrange / Program.fs
Last active September 21, 2024 20:07
SixelImage
(*
MIT License
Copyright (c) 2024 Mårten Rånge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@mrange
mrange / Program.fs
Created September 20, 2024 21:01
Sixel
open System
open System.Diagnostics
open System.Text
open System.Threading
let inline fract x = x - floor x
let rec mandelbrot (x : float) (y : float) (cx : float) (cy : float) i =
if i > 0 then
let x2 = x*x
@mrange
mrange / program.cs
Created May 16, 2024 05:39
collection literals C#
// Gives an array of 3 elements
IEnumerable<ulong> x0 = Enumerable.Concat<ulong>([1], Unbounded());
ulong[] y0 = x0.Take(3).ToArray();
// Crashes with out of memory after some time
IEnumerable<ulong> x1 = [1, ..Unbounded()];
ulong[] y1 = x0.Take(3).ToArray();
IEnumerable<ulong> Unbounded()
@mrange
mrange / program.cs
Created April 2, 2024 18:09
Sieve Of Eratosthenes (C#)
var primes = SieveOfEratosthenes(100);
var primes_ = string.Join(',', primes);
Console.WriteLine(primes_);
int[] SieveOfEratosthenes(int n)
{
bool[] noPrime = new bool[n];
@mrange
mrange / bombs.fs
Created March 10, 2024 14:32
F# Bombs away
open System
open System.Globalization
open System.Windows
open System.Windows.Media
open System.Windows.Threading
open FSharp.Core.Printf
type CellSymbol =
| Empty
@mrange
mrange / tic80.lua
Last active September 27, 2023 11:14
Rotating cube in TIC-80
BPM =80
function v3(x,y,z)
return {x,y,z}
end
model = {
vertices = {
v3(-1,-1,-1),
@mrange
mrange / tic80.lua
Last active September 23, 2023 12:08
My first TIC-80 program
function clamp(value, min, max)
return math.min(math.max(value, min), max)
end
function mix(a,b,x)
return a+(b-a)*x
end
function pmin(a,b,k)
local h = clamp(0.5+0.5*(b-a)/k, 0.0, 1.0)
@mrange
mrange / RecordArray.cs
Created May 15, 2023 12:35
RecordArray C#
namespace MyNamespace
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;