Skip to content

Instantly share code, notes, and snippets.

@colbylwilliams
colbylwilliams / ade-oidc.sh
Last active November 8, 2023 23:53
This script will create an AAD app, service principal, and OIDC federated credentials for each # environment type in a GitHub repository. It assigns each environment type's AAD app the Reader # role to the DevCenter project and the Deployment Environments User role to the DevCenter project # environment type. Finally it creates a repository envi…
#!/bin/sh
# This script will create an AAD app, service principal, and OIDC federated credentials for each
# environment type in a GitHub repository. It assigns each environment type's AAD app the Reader
# role to the DevCenter project and the Deployment Environments User role to the DevCenter project
# environment type. Finally it creates a repository environment corrisponding to each environment
# type and sets an environment variable AZURE_CLIENT_ID with the client id for AAD app.
repo_org=REPOSITORY_ORGANIZATION # e.g. "contoso"
repo_name=REPOSITORY_NAME # e.g. "eShop"
@colbylwilliams
colbylwilliams / aib-devbox.bicep
Created July 7, 2023 18:10
Test creating custom images for DevBox using first party CPC and VS base images and Azure Image Builder.
param location string = resourceGroup().location
@description('Object ID for the first-party Windows 365 enterprise application in your tenant. You find this ID in the Azure portal or via the Azure CLI: `az ad sp show --id 0af06dc6-e4b5-4f28-818e-e78e62d137a5 --query id`')
param windows365PrinicalId string
param version string = '1.0.0'
param replicationRegions array = [ 'eastus' ]
param tags object = {}
# docs: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-troubleshoot#sysprep-timing
Write-Host '>>> Waiting for GA Service (RdAgent) to start ...'
while ((Get-Service RdAgent -ErrorAction SilentlyContinue) -and ((Get-Service RdAgent).Status -ne 'Running')) { Start-Sleep -s 5 }
Write-Host '>>> Waiting for GA Service (WindowsAzureTelemetryService) to start ...'
while ((Get-Service WindowsAzureTelemetryService -ErrorAction SilentlyContinue) -and ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running')) { Start-Sleep -s 5 }
Write-Host '>>> Waiting for GA Service (WindowsAzureGuestAgent) to start ...'
while ((Get-Service WindowsAzureGuestAgent -ErrorAction SilentlyContinue) -and ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running')) { Start-Sleep -s 5 }
public static void ConstrainToParentCenter(this UIView view, nfloat height = default(nfloat), nfloat width = default(nfloat))
{
if (view?.Superview == null) throw new InvalidOperationException("Must add view to a superview before calling this method");
view.TranslatesAutoresizingMaskIntoConstraints = false;
var verticalFormat = string.Format("V:[super]-(<=1)-[view{0}]", height == default(nfloat) ? string.Empty : $"({height})");
var horizontalFormat = string.Format("H:[super]-(<=1)-[view{0}]", width == default(nfloat) ? string.Empty : $"({width})");
public class SightCallEventListener : Java.Lang.Object
{
[Export]
[Subscribe]
public void OnEngineStatusEvent(Event evt)
{
Console.WriteLine ("OnEngineStatusEvent: {0}", evt.ToString());
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
using HockeyApp.iOS;
namespace AppToTrack.iOS
#!/bin/bash
manifestPath=
placeholderKey=
googleMapsKey=
while getopts "m:p:g:" o; do
case "${o}" in
m) manifestPath="${OPTARG}" ;;
p) placeholderKey="${OPTARG}" ;;
@colbylwilliams
colbylwilliams / CustomWebView.cs
Created January 13, 2016 20:29
UIWebView subclass that only displays Copy & Paste
using Foundation;
using UIKit;
using CoreGraphics;
using ObjCRuntime;
using MobileCoreServices;
namespace WebViewExample.iOS
{
public class CustomWebView : UIWebView
{