Skip to content

Instantly share code, notes, and snippets.

View stefangordon's full-sized avatar

Stefan Gordon stefangordon

  • Stacklet
  • WA, USA
View GitHub Profile
stefangordon /
Last active March 19, 2019 19:08
Azure Storage Account with KeyVault encryption via ARM Templates
echo Deploying a storage account encrypted with a KeyVault key is a two step process
echo because changing the storage settings must happen after the access policy is configured
echo and we are unable to "DependOn" an access policy.
echo This shell script is just an example of how to run the two templates via the Azure CLI
read -p 'Resource Group: ' rgName
echo $rgName
stefangordon / mjpegexample.js
Created December 21, 2016 16:13
React Native MJPEG
View mjpegexample.js
var styles = StyleSheet.create({
backgroundVideo: {
return (
View BingImageSearch.cs
static async void FindAndRetrieveImage()
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", <AppId Goes Here>);
// Request parameters
queryString["q"] = string.Format("{0}", "grumpy cat");
View enable_cors.cs
public static void SetWildcardCorsOnBlobService(this CloudStorageAccount storageAccount)
storageAccount.SetCORSPropertiesOnBlobService(cors =>
var wildcardRule = new CorsRule() { AllowedMethods = CorsHttpMethods.Get, AllowedOrigins = { "*" } };
return cors;

Replacing .css files in-place. Blobs will be replaced with compressed version and headers updated: asge.exe -e .css -f myContainer -r -a myStorageAccount -k <key>

Copy .css and .js to a compressed version and append a .gz extension: asge.exe -e .css .js -f myContainer -n .gz -a myStorageAccount -k <key>

Replacing .js files in-place and enabling CORS for the account: asge.exe -w -e .js -f myContainer -r -a myStorageAccount -k <key>

Replacing .js files in-place using a connection string instead of host/key:

View MapExampleComponent.js
'use strict';
import React from 'react';
import { render } from 'react-dom';
import { Map, Marker, Popup, TileLayer } from 'react-leaflet';
import BingTileLayer from './BingTileLayer.js';
class MapExampleComponent extends React.Component {
render() {
var position = [41.9792489190354, -71.2239789962769];
View BingTileLayer.js
'use strict';
import { PropTypes } from 'react';
import { BaseTileLayer } from 'react-leaflet';
export default class BingTileLayer extends BaseTileLayer {
static propTypes = {
bingKey: PropTypes.string.isRequired,
type: PropTypes.string.isRequired
stefangordon / .deployment
Created October 21, 2015 15:57
Kudu deployment manifest
View .deployment
command = deploy.cmd
stefangordon / deploy.cmd
Created October 21, 2015 15:55
Kudu Deploy Script for Azure Website + Webjob
View deploy.cmd
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Deploy Web App and Web Job
:: Version: 1.0.2
:: ----------------------
:: Prerequisites (You don't need to modify anything here)
:: -------------------------------------------------------
stefangordon / pyrite_stuff
Last active September 14, 2015 14:58
Visualize Large 3D Captures using Pyrite3D
View pyrite_stuff
layout: post
title: "Visualize Large 3D Captures using Pyrite3D"
author: "Stefan Gordon"
author-link: ""
date: 2015-09-10 10:00:00
categories: Azure 3D Unity3D Streaming Pyrite3D
color: "blue"
excerpt: "Large scale 3D reconstructions created from aerial data captures are quickly becoming an important tool for many industries including commercial construction, agriculture and mining."