Skip to content

Instantly share code, notes, and snippets.

@JeffJacobson
JeffJacobson / FileSystemExtensions.cs
Created February 27, 2015 01:40
Utilities for walking through file systems
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
public static class FileSystemExtensions
{
/// <summary>
@JeffJacobson
JeffJacobson / Tyr meds.md
Last active May 26, 2017 18:48
Tyr's Medications

Tyr's Medications

Pimobendan (Vetmedin) 1.25 mg tablets

Give 1 tablet (1.25mg) by mouth every 12 hours. This medication is used to increase cardiac contractile ability (inotropy) while also serving as a vasodilator (therefore an 'inodilator').

Clopidogrel 75 mg tablets

@JeffJacobson
JeffJacobson / ExportToCsv.pyt
Last active October 9, 2017 10:25
ArcGIS conversion: Table View to CSV
import arcpy
import arcpy.da as da
import arcgiscsv
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "Export to CSV Toolbox"
self.alias = "csv"
@JeffJacobson
JeffJacobson / Clone-SvnToGit.ps1
Last active February 3, 2021 00:38
One-way clone from SVN to Git
<#
.SYNOPSIS
Clones an Subversion repository into a Git repository.
.DESCRIPTION
Clones a Subversion repository into a Git repository, for migrating from Subversion to Git.
This is a scripted version of the processed outlined here:
http://web.archive.org/web/20161107131841/https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git
.EXAMPLE
PS C:\> .\Clone-SvnToGit.ps1 https://example.com/path/to/svn/myrepo/trunk users.txt
This will clone the SVN repository at the given URL into a git repository folder called "myrepo",
@JeffJacobson
JeffJacobson / Run-PythonUnitTests.ps1
Last active February 23, 2017 16:36
Runs Python unittests against multiple Python environments
<# Runs Python unit tests in multiple environments #>
# Get python.exe paths.
$pyenvs = Get-ChildItem -Path "C:\Python*\" -Filter "python.exe" -Recurse
$pyenvs += Get-ChildItem -Path "C:\Program Files\ArcGIS" -Filter "python.exe" -Recurse
# Build the list of modules that will be tested.
$modules_to_test = [string]::Join(" ", @(
"test_travelerinfo",
"test_armcalc",
@JeffJacobson
JeffJacobson / GetArcGis-Token.ps1
Last active March 30, 2023 20:32
ArcGIS Online / Portal Powershell scripts
class Token {
[string] $token
[System.DateTimeOffset] $expires
Token($response) {
$this.token = $response.token;
$this.expires = [System.DateTimeOffset]::FromUnixTimeMilliseconds($response.expires)
}
}
$rootUri = "https://www.arcgis.com/sharing/rest"
@JeffJacobson
JeffJacobson / README.md
Last active March 19, 2022 14:32
Python script to dump ArcGIS ID messages

dumpidmsg.py

This is a python script to dump ArcGIS ID messages.

@JeffJacobson
JeffJacobson / Find-SDKTool.ps1
Created August 22, 2017 19:05
A script that finds different versions of Windows .NET SDK tools in expected directories.
<#
.SYNOPSIS
Finds an SDK tool in .NET SDK folders
.INPUTS
Name of tool (exe filename) to search for. (E.g., svcutil.exe)
.OUTPUTS
Outputs a list of matching filenames along with properties about the directories
* Windows SDK version
* .NET version
* 32- or 64-bit exe
@JeffJacobson
JeffJacobson / New-PipIndex.ps1
Created November 6, 2017 21:40
Utility for generating an index for pip
<#
.SYNOPSIS
Creates an index HTML page listing Python packages in the current directory.
.DESCRIPTION
Creates an index HTML page listing Python packages in the current directory.
.EXAMPLE
PS C:\> .\New-Index.ps1
Creates the index file and saves it to index.html
.INPUTS
Inputs (if any)
@JeffJacobson
JeffJacobson / BikePedOpenDataUrl.arcade.js
Last active September 6, 2018 20:35
WSDOT Arcade expressions
// Gets the Open Data portal URL filtered to just this location
"https://gisdata-wsdot.opendata.arcgis.com/datasets/46a11f7e043842a5bfbbb1b69e7e4900_0/data?where=LocationID%20%3D%20%27" + $feature.LocationID + "%27"