Skip to content

Instantly share code, notes, and snippets.

View pjmagee's full-sized avatar
🤨

Patrick Magee pjmagee

🤨
View GitHub Profile
@pjmagee
pjmagee / rfc3339
Created May 6, 2024 21:47
RFC 3339 Easy.
void Main()
{
string[] formats =
{
"yyyy-MM-dd'T'HH:mm:ss.fffffffK",
"yyyy-MM-dd'T'HH:mm:ss.ffffffK",
"yyyy-MM-dd'T'HH:mm:ss.fffffK",
"yyyy-MM-dd'T'HH:mm:ss.ffffK",
"yyyy-MM-dd'T'HH:mm:ss.fffK",
"yyyy-MM-dd'T'HH:mm:ss.ffK",
class Spec {
[string]$url
[string]$product
Spec([string]$url, [string]$product) {
$this.url = $url
$this.product = $product
}
}
function Open-Exercise {
param(
[Parameter(ValueFromPipeline = $true, Mandatory = $false)]
[string]$outputFromCommand
)
Process {
$goLandPath = "goland"
Write-Host $outputFromCommand
$path = $outputFromCommand -split "`n" | Select-Object -Last 1
function Open-Exercise {
param(
[Parameter(ValueFromPipeline = $true, Mandatory = $false)]
[string]$outputFromCommand
)
Process {
$goLandPath = "goland"
Write-Host $outputFromCommand
$path = $outputFromCommand -split "`n" | Select-Object -Last 1
piVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: pod1
name: pod1
namespace: default
spec:
containers:
/*
Have you ever played Minesweeper? Well, the goal of the game is to find all the mines within an MxN field. To help you,
the game shows a number in a square which tells you how many mines there are adjacent to that square. For instance, take
the following 4x4 field with 2 mines (which are represented by an * character):
* . . .
. . . .
. * . .
. . . .
kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx-app.yaml
@pjmagee
pjmagee / deployment.yaml
Last active March 6, 2024 16:21
Automation Test k8s
apiVersion: apps/v1
kind: Deployment
metadata:
name: your-deployment-name
namespace: your-namespace
spec:
replicas: 1
selector:
matchLabels:
app: your-app
void Main()
{
var g = new Graph();
var p = new Player();
p.Location = g.Edges[3];
var destination = g.Nodes[0];
PathFinder finder = new PathFinder();
@pjmagee
pjmagee / pathing.cs
Created January 10, 2024 20:42
flat nodes and edges
void Main()
{
var g = new Graph();
var p = new Player();
p.Location = g.Nodes[0];
var destination = g.Edges[3];
PathFinder finder = new PathFinder();
finder.FindPath(g, p.Location, destination).Dump();