Skip to content

Instantly share code, notes, and snippets.

View SteGriff's full-sized avatar
🎣

Stephen Griffiths SteGriff

🎣
View GitHub Profile
@SteGriff
SteGriff / Unsmart.htm
Last active July 16, 2026 10:28
Unsmart.htm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Unsmart</title>
<style>
* { box-sizing: border-box; }
body {
font-family: Arial, sans-serif;
margin: 1rem;
@SteGriff
SteGriff / devops-stage-parameters.md
Created July 13, 2026 12:58
DevOps Stage Parameters

DevOps stage parameters

When you're editing a Release in DevOps point-and-click Release designer, and you used the "IIS Deploy Template" or added an "IIS website deployment" stage/job, then:

If you want to turn an input field into a grey linked field, you can paste in a parameter name.

This one grabs the website name from the "IIS website deployment" stage header:

$(Parameters.WebsiteName)

@SteGriff
SteGriff / copilot-instructions.md
Last active June 4, 2026 13:59
M365 CoPilot Instructions Iterations

PRIORITY OVERRIDE STYLISTIC RULES:

Respond terse like smart caveman. All technical substance stay. Only fluff die.

Rules

MUST DROP: filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK.

MUST USE Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.

@SteGriff
SteGriff / playground.kt
Created January 28, 2026 14:37
Kotlin playground
import java.time.LocalDate
fun main(){
// Currying and function types
val sum = {a : Int, b : Int -> a + b}
fun add(a: Int, b: Int) = a + b
val add2 = {a : Int -> sum(a,2)}
println(sum(2,2))
println(add2(3))
println(add(3,3))
@SteGriff
SteGriff / day_of_week.rb
Created January 2, 2025 16:30
A Ruby function to get day of week (Gregorian)
def day_of_week(day, month, year)
# Zeller's Rule - Jan/Feb are Month 13/14 of previous year
if month < 3
month += 12
year -= 1
end
k = year % 100
j = year / 100
# Zeller's congruence
h = (day + (13 * (month + 1)) / 5 + k + (k / 4) + (j / 4) - (2 * j)) % 7
@SteGriff
SteGriff / blogroll.txt
Last active December 19, 2025 14:27
Blogroll
# Blogroll
## IRL friends and colleagues who have websites
https://dominicbisset.co.uk/ - Dom and I met as teens, worked together for years at Village, and we occasionally play board games.
https://stevenjwright.me/ - Steven has been my friend since high school and we recently reconnected. He turned out pretty cool.
https://michaelbanner.substack.com/ - Mike taught me a lot of dev stuff at Village, and is now an engineering manager.
https://mtempleheald.github.io/ - Mark is an engineer at MSG.
https://rodlaycock.co.uk/ - Rod is a principal eng at MSG.
https://www.mjwals.co.uk/ - Matt worked with me for a few years at Paymentshield/Atlanta.
@SteGriff
SteGriff / yetnoti.txt
Created January 27, 2024 21:52
Yet not I lyrics
What gift of grace is Jesus my redeemer,
There is no more for heaven now to give
He is my joy, my righteousness, and freedom
My steadfast love, my deep and boundless peace
To this I hold, my hope is only Jesus
For my life is wholly bound to his
Oh how strange and divine, I can sing: all is mine!
Yet not I, but through Christ in me
@SteGriff
SteGriff / StringExtensions.cs
Created September 22, 2023 13:53
C# String ReplaceFirst
public static class StringExtensions
{
public static string ReplaceFirst(this string target, string oldString, string newString)
{
int start = target.IndexOf(oldString);
if (start < 0)
return target;
int end = start + oldString.Length;
@SteGriff
SteGriff / async-promises.htm
Created February 9, 2023 16:14
Async and promises in JS - a proof of concept for returning values from async fns
<html>
<head><style>div{margin:2em;} ul{padding:0;}</style>
<body>
<div>
<ul>
<li>Open the DevTools console</li>
<li>Press Go</li>
<li>Data will be fetched from server (<code>return await fetch().then()</code>)</li>
<li>Press Go again</li>
<li>Data will be returned locally from the async function (<code>return todos</code>)</li>
@SteGriff
SteGriff / move-last-git-commit-to-different-branch.md
Last active January 25, 2023 14:42
Move last git commit to a different branch

Move last git commit to a different branch

So you committed to main instead of your feature branch? Oops! But it's ok. All commits in git are special little things that are easy to chip up and kick around ⚽

If you need to do any sleuthing first, use

git log