Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Gordon stefangordon

View GitHub Profile
@stefangordon
stefangordon / deploy.sh
Last active Mar 19, 2019
Azure Storage Account with KeyVault encryption via ARM Templates
View deploy.sh
#!/bin/bash
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
View mjpegexample.js
var styles = StyleSheet.create({
backgroundVideo: {
width:400,
height:322
}
})
return (
<View>
<WebView
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 = { "*" } };
cors.CorsRules.Clear();
cors.CorsRules.Add(wildcardRule);
return cors;
});
}
View asge_examples.md

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';
require('leaflet-plugins/layer/tile/Bing.js');
export default class BingTileLayer extends BaseTileLayer {
static propTypes = {
bingKey: PropTypes.string.isRequired,
type: PropTypes.string.isRequired
@stefangordon
stefangordon / .deployment
Created Oct 21, 2015
Kudu deployment manifest
View .deployment
[config]
command = deploy.cmd
@stefangordon
stefangordon / deploy.cmd
Created Oct 21, 2015
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
stefangordon / pyrite_stuff
Last active Sep 14, 2015
Visualize Large 3D Captures using Pyrite3D
View pyrite_stuff
---
layout: post
title: "Visualize Large 3D Captures using Pyrite3D"
author: "Stefan Gordon"
author-link: "http://www.stefangordon.com"
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."
---
You can’t perform that action at this time.