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 / geocortex-get-geometry-service-url.xaml
Created September 19, 2016 06:22
GeoCortex Get Geometry Service URL
<?xml version="1.0" encoding="utf-16"?>
<ClipboardData Version="1.0" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ClipboardData.Data>
<scg:List x:TypeArguments="x:Object" Capacity="1">
<p:Assign x:Name="__ReferenceID0" VirtualizedContainerService.HintSize="603,59">
<p:Assign.To>
<p:OutArgument x:TypeArguments="x:String">[geometryServiceUrl]</p:OutArgument>
</p:Assign.To>
<p:Assign.Value>
<p:InArgument x:TypeArguments="x:String">[(New Uri(assetFeatureServiceUrl)).GetLeftPart(UriPartial.Authority) + "/arcgis/rest/services/Utilities/Geometry/GeometryServer"]</p:InArgument>
@bradbrowne
bradbrowne / get-geometry-service-url.vb
Created September 19, 2016 23:10
Get ArcGIS Geometry Service Url from Feature Service Url in VB.NET
(New Uri(assetFeatureServiceUrl)).GetLeftPart(UriPartial.Authority) + "/arcgis/rest/services/Utilities/Geometry/GeometryServer"
create or replace TRIGGER ASSET.ASSET_ID_BASE_POINT_TR
-- Automatically assigns new ASSET_ID based on a Sequence
BEFORE INSERT
OR UPDATE -- Required for ArcGIS REST API compatibility
ON ASSET.ASSET_BASE_POINT
FOR EACH ROW
DECLARE
BEGIN
IF :NEW.asset_id IS NULL THEN
IF :OLD.asset_id IS NULL THEN
<?xml version="1.0" encoding="UTF-8"?>
<ClipboardData xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Version="1.0">
<ClipboardData.Data>
<scg:List x:TypeArguments="x:Object" Capacity="1">
<gwa:ReferenceWorkflow x:Name="__ReferenceID0" DisplayName="QueryArray COMPLETED_DATE" VirtualizedContainerService.HintSize="1392,82" WorkflowXamlUri="&amp;quot;gcxfile:///Templates/Workflows/Asset/Shared/QueryArray.xaml&amp;quot;">
<gwa:ReferenceWorkflow.Arguments>
<p:InArgument x:TypeArguments="scg:Dictionary(x:String, x:Object)" x:Key="QueryDictionar
public class SampleRequestValidator : RequestValidator
{
protected override bool IsValidRequestString( HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex )
{
validationFailureIndex = 0;
if ( requestValidationSource == RequestValidationSource.Form
&& collectionKey.Equals( WSFederationConstants.Parameters.Result, StringComparison.Ordinal ) )
{
SignInResponseMessage message = WSFederationMessage.CreateFromFormPost( context.Request ) as SignInResponseMessage;
if ( message != null )
set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
set-location ZoneMap\Domains new-item BRAD-SERVER
set-location BRAD-SERVER
new-itemproperty . -Name http -Value 2 -Type DWORD
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "integrated security=SSPI;` data source=$ServerName;` initial catalog=$DatabaseName;"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = "sp_sw_rtree_is_created"
$SqlCmd.Connection = $SqlConnection
$SqlCmd.CommandType = [System.Data.CommandType]'StoredProcedure';
$SqlCmd.Parameters.AddWithValue("@owner", "$OwnerName") >> $null;
$SqlCmd.Parameters.AddWithValue("@table", "$TableName") >> $null;
$SqlCmd.Parameters.AddWithValue("@spatialcolumn", "$SpatialColumn") >> $null;
$SqlCmd.Parameters.AddWithValue("@keycolumn", "$KeyColumn") >> $null;
@bradbrowne
bradbrowne / DatePicker created in RuntimeModifications returns System.String not System.DateTime.xaml
Last active January 19, 2017 01:11
🐛 GeoCortex DatePicker created in RuntimeModifications returns "/Date(milliseconds)/" not System.DateTime
<Activity mc:Ignorable="sap sap2010 sads" x:Class="ActivityBuilder" this:ActivityBuilder.WorkflowContainerName="GistDateMilliseconds"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:gcx="http://apis.geocortex.com/2009"
xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"
xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities"
xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
@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
@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