Skip to content

Instantly share code, notes, and snippets.

@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 / MapQuestInArcGisJSApi.html
Last active September 28, 2019 09:54
Demonstrates using MapQuest Open map service tiles with ArcGIS API for JavaScript.
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css" />
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3compact" type="text/javascript"></script>
<style>
html, body, #map, map.container {
height: 100%;
@JeffJacobson
JeffJacobson / Extensions.cs
Last active January 29, 2019 18:59
ArcObjects extension methods
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 November 15, 2018 22:58
Generate both an mjs (es6 module) and js file using TypeScript
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
@JeffJacobson
JeffJacobson / google-analytics-honor-doNotTrack.js
Last active October 26, 2018 21:11
Google Analytics setup respecting navigator.doNotTrack.
// Setup Google Analytics, but not if user has specified that they don't want to be tracked.
(function (dnt, cookieDomain) {
var scriptTag, hostRe = new RegExp(cookieDomain.replace(".", "\\.") + "$");
if (dnt !== "yes" && dnt !== "1") {
window.ga = window.ga || function () { (ga.q = ga.q || []).push(arguments) }; ga.l = +new Date;
ga('create', 'YOUR-ID-HERE', hostRe.test(location.host) ? cookieDomain : "auto");
ga(function (tracker) {
tracker.set("appName", "Your app name here");
tracker.send('pageview');
});
@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"
@JeffJacobson
JeffJacobson / WebMercatorGeographicConversion.cs
Created October 23, 2012 18:12
Functions to convert between web mercator and geographic coordinates.
// from http://www.gal-systems.com/2011/07/convert-coordinates-between-web.html
private void ToGeographic(ref double mercatorX_lon, ref double mercatorY_lat)
{
if (Math.Abs(mercatorX_lon) < 180 && Math.Abs(mercatorY_lat) < 90)
return;
if ((Math.Abs(mercatorX_lon) > 20037508.3427892) || (Math.Abs(mercatorY_lat) > 20037508.3427892))
return;
@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 / 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 / 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