Skip to content

Instantly share code, notes, and snippets.

@TAGC
TAGC / BranchContext.cs
Last active March 29, 2023 12:39
EF Core migration generation issue
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Experiment.Lib
{
public sealed class BranchContext : DbContext
{
public DbSet<Order> Orders { get; set; }
// Uncommenting this causes a different migration to be generated.
@TAGC
TAGC / SnakeGame.cs
Last active June 14, 2024 09:01
Basic snake game implemented in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
public static class Program
{
public static async Task Main(string[] args)
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class Program
{
public static void Main()
{
var game = GameGenerator.NewGame();
@TAGC
TAGC / find-pi.bat
Created July 17, 2017 08:06
Locates the IP address of a Raspberry Pi on a network
@Echo off
REM Locates the (dynamic) IP Address of a Raspberry Pi on a network
REM Note that with Git Bash, it's possible to invoke batch scripts
REM This lets you do something like this:
REM $ ssh your-login@$(./find-pi.bat)
Set "PiMac=b8-27-eb"
Set "Range=172.16.1"
@TAGC
TAGC / tictactoe.py
Last active July 16, 2017 23:43
Variable sized Tic-Tac-Toe end game detection logic in Python
from itertools import permutations
import math
X = 'X'
O = 'O'
_ = ' '
def inter_value_differences(values):