Skip to content

Instantly share code, notes, and snippets.

View eNeRGy164's full-sized avatar
🕹️

Michaël Hompus eNeRGy164

🕹️
View GitHub Profile
@eNeRGy164
eNeRGy164 / maildirparser.sh
Created July 30, 2020 05:01
Getting email recipient addresses from maildir
#! /bin/sh
#
# Get a directory name as input and grep the address the mail is sent to
#
# Based on a script by Joerg Reinhardt, but don't blame him for my mistakes
# Check for argument or help argument respectively
if [[ ($1 == "") ||
($1 == "-h") ||
($1 == "--help") ||
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
// Ensure the demo web app is unique within Azure
"uniqueSuffix": "[tolower(uniqueString(resourceGroup().Id))]",
"appPlanName": "[concat('demo-web-app-plan-', variables('uniqueSuffix'))]",
"appName": "[concat('demo-web-app-', variables('uniqueSuffix'))]",
// "Remote" Container Registry
@eNeRGy164
eNeRGy164 / StorageConnectionStringUDF.json
Created May 19, 2020 11:55
Azure Resource Manager template using a User-Defined Function to create the Storage Connection String
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"functions": [
{
"namespace": "storage",
"members": {
"connectionString": {
"parameters": [
{
param(
[string]$resourceGroup,
[string]$storageAccountName
[string]$webAppName
)
Import-Module AzureRM.Storage
$sa = Get-AzureRmStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccountName
@eNeRGy164
eNeRGy164 / LoremIpsumKeyVault.json
Last active March 19, 2021 06:34
Deployment Template sample adding Secrets to a Azure Key Vault
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "LoremVault",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
@eNeRGy164
eNeRGy164 / LoremIpsumWebApp.json
Created March 13, 2017 15:04
Deployment Template sample with Virtual Applications and Virtual Directories
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"kind": "app",
"name": "LoremIpsumAppService",
"sku": {
"name": "B1"
@eNeRGy164
eNeRGy164 / Format-HtmlValidityOutput.ps1
Last active February 18, 2017 20:22
A PowerShell script that formats the output of the Test-HtmlValidity script. Also support grouped input on the URL property.
<#
.SYNOPSIS
Formats the output of the Test-HtmlValidity script
.DESCRIPTION
Formats the output of the Test-HtmlValidity script. Also support grouped input on the URL property.
.NOTES
Author: Michaël Hompus
License: This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 Generic License.
.PARAMETER Messages
One or more output messages from the HTML validity PowerShell Script.
@eNeRGy164
eNeRGy164 / Test-HtmlValidity.ps1
Created February 18, 2017 18:35
A PowerShell script that validates one or more URLs against the W3C HTML validation service. Returns info, warning and error messages. You can also switch on messages for valid pages.
<#
.SYNOPSIS
Validates one or more URLs against the W3C HTML validation service
.DESCRIPTION
Validates one or more URLs against the W3C HTML validation service. Returns info, warning and error messages. You can also switch on messages for valid pages.
.NOTES
Author: Michaël Hompus
License: This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 Generic License.
.PARAMETER Urls
One or more URLs to check for HTML validity.
@eNeRGy164
eNeRGy164 / ConvertFrom-SiteMap.ps1
Last active September 14, 2022 21:15
A PowerShell script that downloads an XML Sitemap and parses the content to retrieve all the information. If the file contains Sitemap Index entries those links will be followed as well.
<#
.SYNOPSIS
Returns all URLs and optional metadata from an XML Sitemap
.DESCRIPTION
Downloads an XML Sitemap and parses the content to retrieve all the information. If the file contains Sitemap Index entries those links will be followed as well.
.NOTES
Author: Michaël Hompus
License: This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 Generic License.
.PARAMETER Url
The URL for a XML Sitemap file
private void PullDownToRefreshPanel_LayoutUpdated(object sender, EventArgs e)
{
if (this.targetScrollViewer == null)
{
this.targetScrollViewer = FindVisualElement<ScrollViewer>(VisualTreeHelper.GetParent(this));
if (this.targetScrollViewer != null)
{
this.LayoutUpdated -= PullDownToRefreshPanel_LayoutUpdated;
// *snip*