Skip to content

Instantly share code, notes, and snippets.


steveoh steveoh

Block or report user

Report or block steveoh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 / 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">
<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 /
Last active Mar 13, 2019
list usused domains and fields with domain
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 / get all domains.sql
Last active Mar 13, 2019
get domain name/code/value from an SDE database
View get all domains.sql
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'
items.Type = itemtypes.UUID
items.Definition.nodes('/GPCodedValueDomain2/CodedValues/CodedValue') AS CodedValues(coded_value)
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;
steveoh /
Last active Mar 19, 2018
dev summit recap

devsummit 2018

  • maturaty dev summit. not many ground breaking features. more polish
  • Machine learning and AI were big this year with the keynote being from microsoft and the introduction of a geovm in azure that can be provisioned.
  • Some cool demo's on training models to understand data and then letting them predict the future or act on other data was pretty cool.
  • utah roads/crash data was used in the keynote


  • 10.6 has a new geocoding engine but users can't create them until pro 2.2. around UC
steveoh /
Last active Dec 13, 2017
replaces the code for value in a new _value field
def replace_codes_with_values(feature_class, field_info, domain_info):
field_domain_map = [(field, field.domain) for field in field_info if field.domain]
fields = [field[0] for field in field_domain_map]
field_names = [ for field in fields]
domain_names = [domain[1] for domain in field_domain_map]
domain_lookup = {}
for name in domain_names:
domain_lookup[name] = [domain for domain in domain_info if == name][0]
steveoh / splitline.cs
Last active Dec 8, 2017
split a line based on a user click
View splitline.cs
var shape = (Polyline)row["Shape"];
var point = (MapPoint)GeometryEngine.Instance.Project(userClickGeometry, shape.SpatialReference);
var proximity = GeometryEngine.Instance.NearestPoint(shape, point);
var distance = proximity.Distance * 2;
var vertices = new List<Coordinate2D>
new Coordinate2D(point),
new Coordinate2D(proximity.Point),
steveoh /
Created Nov 13, 2017
Update layer symbology with arcpy
import json
import arcpy
def resize_symbol(layer):
if not layer.isFeatureLayer:
symbology = json.loads(layer._arc_object.getsymbology())

Keybase proof

I hereby claim:

  • I am steveoh on github.
  • I am steveoh ( on keybase.
  • I have a public key whose fingerprint is E5D4 9904 BB9D 3482 A06A DE5D 2143 A56C 0A0A 53CD

To claim this, I am signing this object:

You can’t perform that action at this time.