Skip to content

Instantly share code, notes, and snippets.

View GordonBeeming's full-sized avatar
💭
delivering value

Gordon Beeming [SSW • Microsoft MVP] GordonBeeming

💭
delivering value
View GitHub Profile
@GordonBeeming
GordonBeeming / Switch Windows TimeZone.ps1
Created October 23, 2023 02:44
After moving to Brisbane, Australia from South Africa, my pc kept saying it's in South Africa when plugged into my old routers... Changing the routers network time did nothing... this helped (for now at least)
# HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
# https://www.elevenforum.com/t/change-time-zone-in-windows-11.806/
Get-TimeZone -name "E. Australia Standard Time"
Get-TimeZone -ListAvailable
tzutil /s "E. Australia Standard Time"
@GordonBeeming
GordonBeeming / chat-gpt4-prompt.txt
Last active July 18, 2023 07:34
This sample is taken from Calum Simpson and helps you with making prompts
// This sample is taken from Calum Simpson (https://www.ssw.com.au/people/calum-simpson/)
// from his user group talk Practical applications for GPT3 | Calum Simpson | Newcastle Coders Group (https://www.youtube.com/watch?v=_uzJTr1vC0o)
For the rest of the conversation you will follow these special extra instructions: For every prompt, give me the following 4 things instead of your regular response:
[💭 Assumptions] list assumptions made in the response
[💬 Response] as normal
[❌ Meta-Critique] critique the prompt and supplied result
[💡 Meta-Suggestions] provide suggestions to address critique
Now wait for my first prompt
@GordonBeeming
GordonBeeming / AddOrEditCode.cshtml
Created December 19, 2022 19:52
Code samples (not exact but will get you going) for How to use the same editor as Visual Studio Code in your sites https://www.youtube.com/watch?v=BnmdyT7iJ9U
@model AddOrEditCodeToPost
@{
ViewData["Title"] = "Blogs Admin";
}
<h1>Add Code: @(Model.Data.BlogTitle)</h1>
<link rel="stylesheet" data-name="vs/editor/editor.main" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.18.0/min/vs/editor/editor.main.css">
<script>var require = { paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.18.0/min/vs' } };</script>
#!/bin/sh
git for-each-ref --format '%(refname:short)' refs/heads | grep -v "master\|main" | xargs git branch -D
@GordonBeeming
GordonBeeming / gist:4f70ee0ee772ec1ff105e77e5470dfe7
Created October 7, 2022 14:54
Fix No Icons on Task Bar on Windows 11
reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f && shutdown -r -t 0
https://answers.microsoft.com/en-us/insider/forum/all/fix-included-no-icons-on-task-bar-on-windows-11/9b580be3-080b-4897-a091-8aefdb6f5b6c
@GordonBeeming
GordonBeeming / Setting up commit signature verification for GitHub.bat
Last active December 3, 2022 14:23
Commands used in the YouTube video Setting up commit signature verification for GitHub https://www.youtube.com/watch?v=9qyjtB9YUJ8
gpg --full-generate-key
gpg --list-secret-keys --keyid-format long
gpg --armor --export xxxxxxxxxxxx
git config --list
git config --global commit.gpgsign true
git config --global user.signingKey xxxxxxxxxxx
// -- adds a small bit of basic auth on the end point using this worker
const NAME = "Admin"
const PASS = "Admins Password for this webhook"
const AzDOHeaderName = "X-Hub-Signature"
const AzDOSecret = "MyWebhookSecret"
const AzDOOrgName = "beeming"
// --------------------------
@GordonBeeming
GordonBeeming / Azure DevOps Descriptors.cs
Last active April 1, 2022 21:46
I always need this and for some reason keep forgetting so storing it and will hopefully remember it's here, missing meta info but enough to remember this with 😁
public class Descriptors
{
/* List
* ====
* scp Project
* aad Azure Active Directory User
* msa Microsoft Account User
* aadgp Azure Active Directory Group
* vss Azure DevOps User
* svc Azure DevOps Service Identity
az login
$ResourceGroupName = "mvpdays-rg"
az account list --output table
az account set --subscription "MVP - Dev Tech"
$CurrentAccount = az account show | Out-string | ConvertFrom-Json
$SubscriptionId = $CurrentAccount.id
$DeploymentServicePrincipalName = "$($ResourceGroupName)SP"
# Create a service principal
sudo nano /etc/resolv.conf
nameserver to 8.8.8.8
echo nameserver to 8.8.8.8 > /etc/resolv.conf
sudo nano /etc/wsl.conf
[network]
generateResolvConf = false