Skip to content

Instantly share code, notes, and snippets.

View stefangordon's full-sized avatar

Stefan Gordon stefangordon

  • The Whole
View GitHub Profile
@stefangordon
stefangordon / pyrite_stuff
Last active September 14, 2015 14:58
Visualize Large 3D Captures using Pyrite3D
---
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."
---
@stefangordon
stefangordon / deploy.cmd
Created October 21, 2015 15:55
Kudu Deploy Script for Azure Website + Webjob
@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 / .deployment
Created October 21, 2015 15:57
Kudu deployment manifest
[config]
command = deploy.cmd
'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
'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];

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:

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;
});
}
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");
@stefangordon
stefangordon / mjpegexample.js
Created December 21, 2016 16:13
React Native MJPEG
var styles = StyleSheet.create({
backgroundVideo: {
width:400,
height:322
}
})
return (
<View>
<WebView
@stefangordon
stefangordon / deploy.sh
Last active March 19, 2019 19:08
Azure Storage Account with KeyVault encryption via ARM Templates
#!/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