Skip to content

Instantly share code, notes, and snippets.

Mark Heath markheath

Block or report user

Report or block markheath

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
@markheath
markheath / run-from-package.ps1
Created Jan 14, 2019
Azure Web App run from package demo
View run-from-package.ps1
$location = "West Europe"
$resGroupName = "RunFromPackageDemo"
az group create -n $resGroupName -l $location
$random = Get-Random -Minimum 10000 -Maximum 99999
$storageAccountName = "runfrompackage$random"
az storage account create -n $storageAccountName -g $resGroupName --sku "Standard_LRS"
$connectionString = az storage account show-connection-string -n $storageAccountName -g $resGroupName --query "connectionString" -o tsv
$env:AZURE_STORAGE_CONNECTION_STRING = $connectionString
@markheath
markheath / sfmesh-example-voting-app.json
Created Oct 24, 2018
Service Fabric Mesh voting app.
View sfmesh-example-voting-app.json
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"voteReplicaCount":{
"defaultValue": "1",
"type": "string",
"metadata": {
"description": "The number of service replicas for the vote service."
}
@markheath
markheath / docker-compose-v1.yml
Last active Oct 18, 2019
Elasticsearch docker compose examples
View docker-compose-v1.yml
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.1
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
@markheath
markheath / Program.cs
Created Mar 30, 2017
Example WDL input driven resampling with NAuadio
View Program.cs
void Main()
{
int outRate = 16000;
var inFile = @"E:\example input file.mp3";
var outFile = @"E:\Input Driven Resampled.wav";
using (var reader = new AudioFileReader(inFile))
using (var writer = new WaveFileWriter(outFile, WaveFormat.CreateIeeeFloatWaveFormat(outRate, reader.WaveFormat.Channels)))
{
var read = 0;
@markheath
markheath / index.html
Last active Feb 10, 2017
Flexbox simple blog layout
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="style.css" rel="stylesheet">
</head>
<body>
<div class="container">
@markheath
markheath / function.json
Last active Nov 21, 2016
F# Blob Bindings with Azure Functions
View function.json
{
"bindings": [
{
"name": "inputBlob",
"type": "blobTrigger",
"direction": "in",
"path": "samples-workitems/input/{name}",
"connection": "AzureWebJobsDashboard"
},
{
@markheath
markheath / Azure Service Bus Batching Speed Test.csx
Last active Oct 31, 2016
Azure Service Bus Batching Speed Test
View Azure Service Bus Batching Speed Test.csx
// (created in LINQPad with the following references and namespaces)
// <Query Kind="Statements">
// <Reference>&lt;RuntimeDirectory&gt;\System.Runtime.Serialization.dll</Reference>
// <NuGetReference>WindowsAzure.ServiceBus</NuGetReference>
// <Namespace>Microsoft.ServiceBus</Namespace>
// <Namespace>Microsoft.ServiceBus.Messaging</Namespace>
// </Query>
string connectionString = Util.GetPassword("Test Azure Service Bus Connection String");
const string queueName = "MarkHeathTestQueue";
@markheath
markheath / yahtzee.fs
Created Oct 25, 2016
Yahtzee Kata in F#
View yahtzee.fs
let highestRepeated dice minRepeats =
let repeats = dice |> List.countBy id |> List.filter (fun (_,n) -> n >= minRepeats) |> List.map fst
match repeats with | [] -> 0 | _ -> List.max repeats
let ofAKind n dice =
n * highestRepeated dice n
let sumOfSingle selected dice =
dice |> Seq.filter ((=) selected) |> Seq.sum
@markheath
markheath / function.json
Last active Feb 12, 2017
Azure Functions simple in-memory CRUD web API
View function.json
{
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"webHookTypeX": "genericJson",
"name": "req",
"methods": [
"get",
"post",
@markheath
markheath / ModelessMessage.cs
Created Sep 19, 2016
WinForms show a modeless message dialog
View ModelessMessage.cs
var f = new Form();
var b = new Button();
b.Text = "Show message";
b.AutoSize = true;
f.Controls.Add(b);
b.Click += (s, e) =>
{
var p = new Form();
p.Text = "Hello";
p.Show(f);
You can’t perform that action at this time.