Skip to content

Instantly share code, notes, and snippets.

View bradbrowne's full-sized avatar

Brad Browne bradbrowne

  • Melbourne, Australia
View GitHub Profile
@bradbrowne
bradbrowne / authenticode-code-sign-powershell-script.ps1
Created May 21, 2018 07:25
Signing a Powershell script with Authenticode code signing certificate so that execution policy can be set to AllSigned
Set-ExecutionPolicy AllSigned
$cert = Get-PfxCertificate -FilePath "mapdojo.p12"
Set-AuthenticodeSignature -FilePath "build.ps1" -Certificate $cert
EXEC dbo.Ogr2Ogr @arguments = N' -f "CSV" -overwrite "D:\Flux\Jobs\FluxAssetic\CSV" "MSSQL:server=.;database=Flux;trusted_connection=yes" -t_srs EPSG:4326 -sql "SELECT [Asset Category],[Asset ID],[Asset Name],[Asset Class],[Asset Sub Class],[Asset Type],[Asset Sub Type],[Maintenance Asset Type],[Maintenance Asset Sub Type],Responsibility,[Work Group],[Subdivision Name],[Subdivision Stage Number],[Plan Number],[Date of Construction],Locality,[General Comments],[Ownership Agreement],SP_GEOMETRY FROM [assetic].[Fences]" -lco GEOMETRY=AS_WKT -nln assetic.Fences'
@bradbrowne
bradbrowne / using-command-line-to-kill-remote-desktop-session-on-windows-server-2012.md
Last active April 17, 2018 03:33
Windows 2012 has removed the Remote Desktop Services Manager tools that provide a GUI to view and kill user sessions connected to a server and so now you have to use the command line to perform this.
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> qwinsta
 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
 services                                    0  Disc
>rdp-tcp#30        bbrowne                   2  Active
                   otheruser                 4  Disc
 console admin 11 Active
SELECT PFI,
SCHEME_CODE,
LGA_CODE,
LGA,
ZONE_NUM,
ZONE_STATUS,
ZONE_CODE,
ZONE_DESCRIPTION,
GAZ_BEGIN_DATE,
PFI_CREATED,
@bradbrowne
bradbrowne / ComboBoxSetParametersAtRuntime.xaml
Last active March 15, 2018 23:44
🐛 GeoCortex Setting ComboBox parameters in Runtime Modifications Sequence
<Activity mc:Ignorable="sads sap sap2010" x:Class="ActivityBuilder" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client"
xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client"
xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core"
xmlns:gcx="http://apis.geocortex.com/2009"
xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi"
xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"
xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting"
@bradbrowne
bradbrowne / mapbox-vicmap-api.html
Created February 22, 2018 06:04
MapBox Example using VicMap API
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }

Keybase proof

I hereby claim:

  • I am bradbrowne on github.
  • I am bradbrowne (https://keybase.io/bradbrowne) on keybase.
  • I have a public key ASBB3PWcONOrA8fyrstbdJItm_K6-Svpf4ThkpOgJv8q9wo

To claim this, I am signing this object:

@bradbrowne
bradbrowne / geocortex-file-upload-issue.xaml
Last active March 3, 2017 01:45
🐛 GeoCortex FilePicker uploads file multiple times if FileItem properties are accessed multiple times.
<Activity mc:Ignorable="sap sap2010 sads" x:Class="ActivityBuilder" this:ActivityBuilder.WorkflowContainerName="FileUploadIssue"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client"
xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client"
xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core"
xmlns:gcx="http://apis.geocortex.com/2009"
xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi"
xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"
xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting"
@bradbrowne
bradbrowne / convert-mapinfo-tab-file-to-mapbox-vector-tiles.md
Last active January 29, 2017 05:05
🎗Convert MapInfo TAB file to MapBox Vector Tiles by using OGR to create GeoJSON and then Tippecanoe to create MBTiles SQLite database containing MapBox Vector Tiles.

Convert MapInfo TAB file to MapBox Vector Tiles

Install GDAL

OSGeo4Mac

brew tap osgeo/osgeo4mac

brew link autoconf automake

@bradbrowne
bradbrowne / Convert Local DateTime to UTC Milliseconds.vb
Last active January 10, 2017 07:25
🎗 Convert Local DateTime to UTC Milliseconds in VB.NET
cdate(v.Value).ToUniversalTime().Subtract(New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds