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
View ModelStateDictionaryExtensions.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
public static class ModelStateDictionaryExtensions
public static IEnumerable<string> ToErrors(this ModelStateDictionary dict)
return dict.OrderBy(kvp => kvp.Key)
steveoh / soe.csproj
Last active Dec 17, 2015
automated soe updating
View soe.csproj
<Project DefaultTargets="UpdateSOE" ...>
<Target Name="UpdateSOE" DependsOnTargets="Build">
<!-- Python needs to be in the path -->
<Exec Command="python $(MSBuildProjectDirectory)\PostBuildEvents\"/>
steveoh / updateNugets.cs
Created Oct 8, 2013
basic idea for updating nuget packages
View updateNugets.cs
using System.IO;
using System.Xml.Linq;
using System.Xml.XPath;
using System.Diagnostics;
//version could probably come from REPL input or something
string version = "1.9.1";
/* bunch of file and folder moving around */
steveoh / .gitignore
Created Oct 17, 2016
inverting the gitignore
View .gitignore
steveoh / init.js
Created Jan 31, 2017
an atom command to remove common python debug statements. open your atom config folder. possibly rename init.cson to init.js and place this your file.
View init.js
atom.commands.add('atom-text-editor', 'custom:remove-debug', () => {
const editor = atom.workspace.getActiveTextEditor();
const range = editor.getBuffer().getRange();
const checkpoint = editor.createCheckpoint();
const regex = new RegExp(/\s*from import set_trace\s*set_trace\(\)$|\s*import pdb;?\s*pdb.set_trace\(\)$/, 'gmi');
editor.backwardsScanInBufferRange(regex, range, (iterator) => {
steveoh /
Created Feb 7, 2017
test insert and join vs in where clause
#!/usr/bin/env python
# * coding: utf8 *
A module that tests inserting and joining records
import arcpy
from os.path import basename
steveoh /
Created Apr 3, 2017
get command line args
#!/usr/bin/env python
# * coding: utf8 *
A module that contains sample code to get params
import sys
steveoh /
Created Jun 6, 2017
compare get count vs search cursor perf
#!/usr/bin/env python
# * coding: utf8 *
A module that contains sample code to get params
import arcpy
import timeit

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:

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),
You can’t perform that action at this time.