Skip to content

Instantly share code, notes, and snippets.

Doug Finke dfinke

Block or report user

Report or block dfinke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View run.ps1
param($Request)
function Get-Joke {
$jokes = $(
"Did you hear about the restaurant on the moon? Great food, no atmosphere."
"What do you call a fake noodle? An Impasta."
"How many apples grow on a tree? All of them."
"Want to hear a joke about paper? Nevermind it's tearable."
"I just watched a program about beavers. It was the best dam program I've ever seen."
"Why did the coffee file a police report? It got mugged."
View ImportGitHubAction.ps1
function Get-GitHubActionType {
$scanner.Scan("\w+")
}
function Get-GitHubActionTypeName {
$scanner.Skip($WHITESPACE)
$null = $scanner.Scan($QUOTE)
$scanner.ScanUntil("(?=$QUOTE)")
}
View log.txt
**********************
Windows PowerShell transcript start
Start time: 20190331095548
Username: MAINBOX\Douglas
RunAs User: MAINBOX\Douglas
Configuration Name:
Machine: MAINBOX (Microsoft Windows NT 10.0.17134.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 12336
PSVersion: 5.1.17134.590
View octocat.yml
swagger: "2.0"
info:
description: Octocat
title: Octocat
version: "1.0.0"
host: api.github.com
schemes:
- http
basePath: /
produces:
@dfinke
dfinke / azxps.ps1
Created Mar 28, 2019
Wrapper for azx
View azxps.ps1
function Get-AZX {
param($name = "*")
$r = (Invoke-RestMethod "https://azx.ms/api/list") -split "`n"
$list = $r[5..$($r.count - 5)]
$list |
ConvertFrom-Csv -Delimiter "|" -Header 'Name', 'Description' |
Where-Object {$_.Name -like $Name}
View mathrestapi.yaml
swagger: "2.0"
info:
description: "My Math API"
title: "REST Enpoint for my Math API"
version: "1.0.0"
host: tryaf.azurewebsites.net
schemes:
- https
basePath: /
produces:
@dfinke
dfinke / ShowValues.ps1
Last active Feb 22, 2019
$chart.DataLabel.ShowValue = $true - Shows the data labels in the chart
View ShowValues.ps1
$xlfile = "$env:TEMP\datalabels.xlsx"
rm $xlfile -ErrorAction SilentlyContinue
$data = 1..20 | % {
[PSCustomObject]@{Idx=$_; Amount=Get-Random -Minimum 10 -Maximum 100}
}
$excel = $data | Export-Excel -Path $xlfile -AutoNameRange -PassThru
View svg.ps1
$code = @"
Paper 100
Pen 0
Line 50 77 22 27
Line 22 27 78 27
Line 78 27 50 77
"@
$svg = @()
@dfinke
dfinke / NewWebApp.sh
Last active Dec 19, 2018
How do you translate these `az cli` calls into the PowerShell Az Module?
View NewWebApp.sh
az login --service-principal --username "${SERVICE_PRINCIPAL}" --password "${SERVICE_PASS}" --tenant "${TENANT_ID}"
echo "Creating resource group ${APPID}-group"
az group create -n ${APPID}-group -l eastus
echo "Creating app service plan ${APPID}-plan"
az appservice plan create -g ${APPID}-group -n ${APPID}-plan --sku FREE
echo "Creating webapp ${APPID}"
az webapp create -g ${APPID}-group -p ${APPID}-plan -n ${APPID} --deployment-local-git
View action.log
### STARTED Deploy to Azure 15:31:22Z
Already have image (with digest): gcr.io/cloud-builders/docker
Error response from daemon: manifest for gcr.io/gct-12-i9nuypegpqevsyk9v54odh2/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/3ea1f35636dbf5f99774e4b1aed26c141efab42b98f26ceff74b02a2f1224ff1:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 not found
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon 3.584kB
Step 1/3 : FROM microsoft/azure-cli:2.0.47
2.0.47: Pulling from microsoft/azure-cli
ff3a5c916c92: Pulling fs layer
471170bb1257: Pulling fs layer
You can’t perform that action at this time.