Skip to content

Instantly share code, notes, and snippets.

View sjwaight's full-sized avatar
😎
Happy Days

Simon Waight sjwaight

😎
Happy Days
View GitHub Profile
@sjwaight
sjwaight / meetup-group-query.sh
Created June 12, 2023 00:39
Curl query using meetup.com web UI API to retrieve list of "All user" page for Azure Sydney User Group
curl https://www.meetup.com/mu_api/urlname/members?queries=%28endpoint%3Agroups%2Fazure-sydney-user-group%2Fmembers%2Clist%3A%28dynamicRef%3Alist_groupMembers_azure-sydney-user-group_all%29%2Cmeta%3A%28method%3Aget%29%2Cparams%3A%28filter%3Aall%2Corder%3Aasc%2Cpage%3A1%2Csort%3Avisited%29%2Cref%3AgroupMembers_azure-sydney-user-group_all%29&metadata=clickTracking%3A%21t%2Clogout%3A%21f%2Creferrer%3A%2Fazure-sydney-user-group%2Fmembers%2F%2CretainRefs%3A%21%28self%2Cheaders%2Cgroup%2CmemberCounts_azure-sydney-user-group%2CgroupMembers_azure-sydney-user-group_all%29
@sjwaight
sjwaight / SampleCode.cs
Last active March 28, 2023 00:46
Sample Copilot suggestion sample with comments
//CHCP: Start
/*
Model release: x.xxx.xx
Model date: 2023-03-28
Prompt: a function to calculate the sum of two numbers
*/
public int Sum(int a, int b)
{
return a + b;
}
@sjwaight
sjwaight / connection-logic-app-kv-msi.bicep
Created January 3, 2023 04:41
Bicep file snippet showing how to define the MSI to use when connecting to a key vault.
resource connections_keyvault_resource 'Microsoft.Web/connections@2016-06-01' = {
name: connections_keyvault_name
location: resource_group_location
properties: {
displayName: 'KeyVaultMIAccess'
parameterValueType: 'Alternative'
alternativeParameterValues: {
vaultName: key_vault_name
}
customParameterValues: {}
@sjwaight
sjwaight / logic-app-parameters.bicep
Created January 3, 2023 04:29
Logic Apps Parameters section bicep snippet
parameters: {
'$connections': {
value: {
keyvault: {
connectionId: connections_keyvault_resource.id
connectionName: 'keyvault'
connectionProperties: {
authentication: {
type: 'ManagedServiceIdentity'
}
@sjwaight
sjwaight / key-vault.bicep
Created January 3, 2023 04:15
Sample Azure Bicep snippet showing definition of a Key Vault that uses a Managed Identity
resource key_vault_resource 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: key_vault_name
location: resource_group_location
properties: {
sku: {
family: 'A'
name: 'standard'
}
tenantId: subscription().tenantId
accessPolicies: [
@sjwaight
sjwaight / managed-identity.bicep
Created December 30, 2022 03:34
Sample of Azure Bicep definition for a new Managed Identity
resource managed_service_identity_kv_resource 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managed_identity_name
location: resource_group_location
}
@sjwaight
sjwaight / blogpostsample.json
Created December 16, 2022 04:58
Sample post data for an API call to cross-post content to multiple services.
{
"Title": "A sample blog post",
"Summary": "This is a test blog post summary.",
"Link": "https://blog.siliconvalve.com/"
}
@sjwaight
sjwaight / SetupJava11Dev.ps1
Created November 22, 2022 04:14
Short PowerShell Script that uses Chocolatey to install JDK 11 and Community Editon of IntelliJ IDEA
# Install Java 11 SDK using Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install openjdk --version 11.0.2.01 -y
choco install intellijidea-community -y
@sjwaight
sjwaight / samplerecord.json
Created August 15, 2022 06:39
Sample Cosmos DB record for data received from a sensor
{
"SensorName": "PurpleAir-XXX",
"ReadingTime": "2022-08-15T05:26:41+00:00",
"Latitude": -00.000000,
"Longitude": 00.000000,
"PressureMillibars": 993.75,
"Humidity": 27,
"Temperature": 22,
"Pm25ChannelA": 0,
"Pm25ChannelB": 0,
@sjwaight
sjwaight / anomdetectmodelstatusresponse.json
Created June 16, 2022 02:01
Azure Anomaly Detector API - List models API response sample
{
"models": [{
"modelId": "e88247b4-ed17-11ec-85a9-xxxxxxxxxxx",
"createdTime": "2022-06-16T01:59:08Z",
"lastUpdatedTime": "2022-06-16T02:00:34Z",
"status": "READY",
"displayName": "Air Quality",
"variablesCount": 4
}],
"currentCount": 1,