Skip to content

Instantly share code, notes, and snippets.

View adamstirtan's full-sized avatar
💎

Adam Stirtan adamstirtan

💎
View GitHub Profile
@adamstirtan
adamstirtan / copilot-instructions.md
Created February 3, 2026 14:27
ClassZoo copilot-instructions.md

ClassZoo Copilot Instructions

ClassZoo is a Flutter app (iOS/Android/Web) backed by Supabase for auth, data, and storage. The Flutter project root is src/.

Project structure

src/
├── lib/
│   ├── main.dart              # Entry point
@adamstirtan
adamstirtan / Objects.cs
Created April 15, 2024 13:42
A hierarchy of objects to be serialized into JSON in a single array
public class StreamItemDTO
{
public required long Id { get; set; }
public required string Type { get; set; }
public long? MediaId { get; set; }
public required string Title { get; set; }
public required string Description { get; set; }
public required DateTime Timestamp { get; set; }
@adamstirtan
adamstirtan / gist:815bce42623aca994ba9f887750ac80b
Created March 16, 2024 14:55
ParticleSwarmSharp Quickstart
IRandomization random = new BasicRandomization();
int populationSize = 25;
int dimensions = 1;
double minX = -10;
double maxX = 10;
var particles = new List<IParticle>();
for (int i = 0; i < populationSize; i++)
@adamstirtan
adamstirtan / astar.js
Created January 1, 2024 23:36
A* Algorithm in JavaScript
// A* pathfinding algorithm
function astar(start, end) {
const openSet = [];
const closedSet = [];
openSet.push(start);
while (openSet.length > 0) {
let currentNode = openSet[0];
// Find the node with the lowest total cost in the open set
for (let i = 1; i < openSet.length; i++) {
@adamstirtan
adamstirtan / ProgramLogging.cs
Created October 26, 2023 14:10
.NET console app using dependency injection and ILogger
using System;
using Microsoft.Extensions.DependencyInjection
using Microsoft.Extensions.Logging;
namespace MyApp
{
internal class Program
{
private static void Main(string[] args)
{
@adamstirtan
adamstirtan / ProgramEf.cs
Created October 26, 2023 14:09
.NET Console app using dependency injection and EF Core
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection
namespace MyApp
{
internal class Program
{
private static void Main(string[] args)
@adamstirtan
adamstirtan / Program.cs
Created October 26, 2023 14:07
.NET Console app with dependency injection
using Microsoft.Extensions.DependencyInjection
namespace MyApp
{
internal class Program
{
private static void Main(string[] args)
{
var services = CreateServices();
@adamstirtan
adamstirtan / WrongContext.cs
Created October 24, 2023 15:21
Issues with EF Core context management
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
public class Employee
{
public int EmployeeId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
@adamstirtan
adamstirtan / FixedProgram.cs
Created October 24, 2023 15:18
Fixed design flaws
using System;
class Program
{
static void Main(string[] args)
{
try
{
int[] numbers = new int[5];
int value = numbers[10];
@adamstirtan
adamstirtan / DesignFlawProgram.cs
Created October 24, 2023 15:15
Design flaws in error handling for code review
using System;
class Program
{
static void Main(string[] args)
{
try
{
int[] numbers = new int[5];
int value = numbers[10];