Skip to content

Instantly share code, notes, and snippets.

@JeffJacobson
JeffJacobson / splitCamelCase.js
Last active August 26, 2023 10:42
Splits camelCase or PascalCase words into individual words.
/**
* Splits a Pascal-Case word into individual words separated by spaces.
* @param {Object} word
* @returns {String}
*/
function splitPascalCase(word) {
var wordRe = /($[a-z])|[A-Z][^A-Z]+/g;
return word.match(wordRe).join(" ");
}
@JeffJacobson
JeffJacobson / tocsv.js
Last active July 21, 2023 13:53
JavaScript object to CSV
/**
* Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes.
* @param {string|number|object} theValue
* @param {string} sDelimiter The string delimiter. Defaults to a double quote (") if omitted.
*/
function toCsvValue(theValue, sDelimiter) {
var t = typeof (theValue), output;
if (typeof (sDelimiter) === "undefined" || sDelimiter === null) {
sDelimiter = '"';
@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 / 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 / audio2midi.md
Created January 24, 2023 21:24 — forked from natowi/audio2midi.md
List of open source audio to midi packages
@JeffJacobson
JeffJacobson / commodore-64-colors.json
Last active November 9, 2022 21:05
Commodore 64 color palette JSON and script that generated it
{
"Black": "#000000",
"White": "#FFFFFF",
"Red": "#880000",
"Cyan": "#AAFFEE",
"Violet / purple": "#CC44CC",
"Green": "#00CC55",
"Blue": "#0000AA",
"Yellow": "#EEEE77",
"Orange": "#DD8855",
pip list --outdated --format json | ConvertFrom-Json | foreach { $_.name } | Out-File outdated.txt
pip install -r .\outdated.txt --update
@JeffJacobson
JeffJacobson / index.html
Created June 21, 2022 15:38
MapImageLayer Clipping Sample
<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 / FileSystemExtensions.cs
Created February 23, 2012 18:35
C# extension method for walking the file system.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace FileSystemHelper
{
public static class FileSystemExtensions
{
@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.