Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
respekt

steveoh steveoh

🚀
respekt
View GitHub Profile
View sde_to_agol.py
'''
AGOLPallet.py
A module that contains a pallet definition for the data that gets pushed to AGOL.
'''
import re
import traceback
from datetime import timedelta
from os import mkdir, rename
from os.path import basename, dirname, join
@steveoh
steveoh / module-main.tf
Last active Nov 24, 2021
GitHub Workflow Identity Federation Terraform module
View module-main.tf
module "gcp_services" {
source = "../gcp-services"
project_id = var.project_id
services = [
"cloudresourcemanager.googleapis.com",
"iam.googleapis.com",
"iamcredentials.googleapis.com",
"sts.googleapis.com"
]
View startup.cs
services.AddMediatR(typeof(Startup));
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(PerformanceLogger<,>));
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
services.AddSingleton(new Lazy<NaicsProvider>(() => new NaicsProvider()));
services.AddScoped<IHasOwnership, OwnershipResolver>();
// add context for computations
services.AddDbContext<AppDbContext>(
options => options
View spatial spec.md

Spatial Filters

Introduction

Create a set of spatial filters based on OGC spatial functions.

Proposal

Example Objects

View search tables.json
[
{
"request_count": "9590125",
"search_table": "sgid10.boundaries.municipalities"
},
{
"request_count": "9509793",
"search_table": "sgid10.location.zipplus4points"
},
{
@steveoh
steveoh / overflow fade.css
Created Jun 18, 2019
fade the bottom of an element
View overflow fade.css
.shorten-sm {
height: 50px;
overflow: hidden;
position: relative;
}
.shorten-sm:before {
content: '';
width: 100%;
height: 100%;
@steveoh
steveoh / react-refactorings-map.js
Last active Jun 5, 2019
common react refactorings... removing duplication with `map`
View react-refactorings-map.js
export default () => {
const [active, setActive] = useState('agent');
return (
<div fluid className="filter-selector">
<ButtonGroup>
<Button color={active === 'agent' ? 'warning' : 'secondary'} onClick={() => setActive('agent')}>Agent</Button>
<Button color={active === 'offender' ? 'warning' : 'secondary'} onClick={() => setActive('offender')}>Offender</Button>
<Button color={active === 'location' ? 'warning' : 'secondary'} onClick={() => setActive('location')}>Location</Button>
<Button color={active === 'date' ? 'warning' : 'secondary'} onClick={() => setActive('date')}>Date</Button>
@steveoh
steveoh / unused_domains.py
Last active Jul 11, 2020
list usused domains and fields with domain
View unused_domains.py
from pprint import pprint
import arcpy
arcpy.env.workspace = r'stage.sde'
output = {}
tables = []
for dirpath, dirnames, walked_tables in arcpy.da.Walk(datatype=['FeatureClass', 'Table']):
@steveoh
steveoh / get all domains.sql
Last active Mar 13, 2019
get domain name/code/value from an SDE database
View get all domains.sql
SELECT
cv_domain.value('DomainName[1]', 'nvarchar(50)') AS 'DomainName',
coded_value.value('Code[1]','nvarchar(50)') AS 'Code',
coded_value.value('Name[1]','nvarchar(50)') AS 'Value'
FROM
sde.GDB_ITEMS AS items INNER JOIN sde.GDB_ITEMTYPES AS itemtypes ON
items.Type = itemtypes.UUID
CROSS APPLY
items.Definition.nodes('/GPCodedValueDomain2/CodedValues/CodedValue') AS CodedValues(coded_value)
CROSS APPLY
@steveoh
steveoh / pro-addin-version.cs
Created Mar 28, 2018
get the version info from a pro addin
View pro-addin-version.cs
var myDocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var arcGisProLocation = Path.Combine(myDocs, "ArcGIS", "AddIns", "ArcGISPro");
var attribute = (GuidAttribute) _assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
var proAddinFolder = $"{{{attribute.Value}}}";
var addinFolder = Path.Combine(arcGisProLocation, proAddinFolder);
if (!Directory.Exists(addinFolder))
return null;