This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("sf") | |
# local variables | |
shapefile_name <- "LSOA_2011_EW_BFC" | |
shape_location <- "C:/mapdata/lsoa/boundaries/demo" | |
columns <- "*" | |
local_tempdir <- "c:/temp" | |
# arrange | |
shapefile <- paste(shape_location, "/", shapefile_name, ".shp", sep = "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!require('PostcodesioR')) { | |
install.packages('PostcodesioR') | |
library('PostcodesioR') | |
} | |
postcodeSet.df <- postcode_lookup("EC1N 2HT") | |
mahSubset <- subset(postcodeSet.df, select=c(postcode, nhs_ha)) | |
# demo 1 row... | |
str(mahSubset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.mahstaff | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.padding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reference: | |
// https://developers.google.com/apps-script/reference/document/body#getchildindexchild | |
// https://developers.google.com/apps-script/reference/document/body#getattributes | |
// https://stackoverflow.com/questions/8273047/javascript-function-similar-to-python-range | |
function log(message) { | |
//Logger.log(message) | |
} | |
function getTextLineFromBody(theBody, index) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit for the basics: | |
// https://github.com/oakserver/oak/blob/main/examples/routingServer.ts | |
// Setup: Install deno | |
// Usage: deno run -A ./DenoPost.ts | |
// Use e.g. Postman to POST the json payload to http://127.0.0.1:8000/book | |
// Use e.g. any browser to read the json in memory: http://127.0.0.1:8000/book | |
import { | |
bold, | |
cyan, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Get the name of each function in the given PowerShell Script. | |
Assumptions: | |
1. the line starts with "function". | |
2. A line starting with "function" is not embedded in a comment block. | |
There is no error handling. | |
#> | |
function Get-FunctionsInScript($script) { | |
Get-Content $script | ForEach-Object { | |
$currentLine = $_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$imageSet = | |
"mcr.microsoft.com/windows/servercore:ltsc2016", | |
"mcr.microsoft.com/windows/servercore:ltsc2019", | |
"mcr.microsoft.com/windows/servercore:10.0.14393.3808" | |
function Run-Container($volumeShare, $image) { | |
if ($image -eq $null) { | |
Write-Host "No image passed in. Select from the following..." | |
$index = 0 | |
$imageSet | ForEach-Object { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-WindowsInfo() { | |
Write-Host "Hostname: $(& HOSTNAME.EXE)" | |
systeminfo /fo csv | ConvertFrom-Csv | Select-Object OS*, System*, Hotfix* | Format-List | |
write-host "Semantic file version..." | |
(Get-ItemProperty -Path C:\Windows\System32\hal.dll).VersionInfo.FileVersion | |
# Write-host "OS Caption..." - redundant | |
# (Get-WmiObject -Class win32_OperatingSystem).Caption | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## Dockerfile | |
#escape=` | |
ARG WINVER=ltsc2019 | |
FROM mcr.microsoft.com/windows/servercore:$WINVER | |
WORKDIR c:\artifacts | |
RUN net user /add dennis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
. $here/Utilities.ps1 | |
#. "C:\Sandbox\docker\utilities\DockerUtilities.ps1" | |
function Remove-AllContainers { | |
$containers = $(docker ps -a) | Select-Object -Skip 1 | |
$containers | ForEach-Object { | |
$containerId = $_.substring(0, 12) | |
Remove-Container $containerId | |
} |
NewerOlder