Skip to content

Instantly share code, notes, and snippets.

@JeffJacobson
JeffJacobson / index.html
Created Jun 21, 2022
MapImageLayer Clipping Sample
View index.html
<html>
<head>
<link rel="stylesheet" href="min.css">
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<!--
ArcGIS API for JavaScript, https://js.arcgis.com
@JeffJacobson
JeffJacobson / Extensions.cs
Last active Jan 29, 2019
ArcObjects extension methods
View Extensions.cs
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Wsdot.ArcGis.Extensions
{
public static class Extensions
@JeffJacobson
JeffJacobson / prepare.js
Last active Nov 15, 2018
Generate both an mjs (es6 module) and js file using TypeScript
View prepare.js
const fs = require("fs");
const { exec } = require("child_process");
/**
* Response from exec
* @typedef ExecResponse
* @type {object}
* @property {?Error} error - If the operation resulted in an error, this will have a value.
* @property {string} stdout - Text written to stdout
View BikePedOpenDataUrl.arcade.js
// 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"
@JeffJacobson
JeffJacobson / wsdot.less
Created Mar 6, 2018
fonts and colors from WSDOT style guide
View wsdot.less
@import (inline,once) "https://fonts.googleapis.com/css?family=Inconsolata|Lato";
/* Colors from WSDOT Style Guide */
@wsdotStdPms0433: #1E252B;
@wsdotStdPms0433_80: lighten(@wsdotStdPms0433, 80%, relative);
@wsdotStdPms0433_60: lighten(@wsdotStdPms0433, 60%, relative);
@wsdotStdPms0433_40: lighten(@wsdotStdPms0433, 40%, relative);
@wsdotStdPms7722: #004f50;
@wsdotStdPms7722_80: lighten(@wsdotStdPms7722, 80%, relative);
@JeffJacobson
JeffJacobson / New-PipIndex.ps1
Created Nov 6, 2017
Utility for generating an index for pip
View New-PipIndex.ps1
<#
.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 / Find-SDKTool.ps1
Created Aug 22, 2017
A script that finds different versions of Windows .NET SDK tools in expected directories.
View Find-SDKTool.ps1
<#
.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 / README.md
Last active Mar 19, 2022
Python script to dump ArcGIS ID messages
View README.md

dumpidmsg.py

This is a python script to dump ArcGIS ID messages.

@JeffJacobson
JeffJacobson / GetArcGis-Token.ps1
Last active Mar 19, 2022
ArcGIS Online / Portal Powershell scripts
View GetArcGis-Token.ps1
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 / Run-PythonUnitTests.ps1
Last active Feb 23, 2017
Runs Python unittests against multiple Python environments
View Run-PythonUnitTests.ps1
<# 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",