Skip to content

Instantly share code, notes, and snippets.

@csmoore
csmoore / FolderImageComparer.cs
Created December 1, 2018 00:24
Basic Normalized Histogram Equalization Compare
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
namespace HistogramTest
@csmoore
csmoore / gh-issues.py
Last active January 26, 2018 22:43 — forked from kgonzago/gh-issues.py
Collects issues from defense repos and output them to a CSV
#-------------------------------------------------------------------------------
# Name: gh-issues
# Purpose: Write issues from a repo to a csv file
# Created: 1/23/2018
#
# Note:
# Original script came from https://gist.github.com/unbracketed/3380407.
# Modified to fit our needs
#
# Example: processes JSON response from api call:
@csmoore
csmoore / csv2htmlTable.py
Created January 26, 2018 21:53
Convert a CSV to an HTML file containing a table
#!/usr/bin/python
# Simple CSV to HTML Table File Converter
# Adapted from: https://gist.github.com/enigmaticape/4016913
import sys
import os
import csv
import string
### Params:
@csmoore
csmoore / ArcGISRestSamples.py
Created October 24, 2017 17:57
Python sample GET/POST calls to ArcGIS REST Service
#------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@csmoore
csmoore / AddHeaderToFiles.py
Last active September 8, 2017 15:51
Recurse a supplied folder and add a file header to all files matching a pattern
#------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Basic PyGithub Example - Example/test of using PyGithub (Python Github API)
# Repo(s) Open Issues List to CSV
# requires PyGithub (and python-jose) :
# pip install PyGithub
# -or- conda install -c conda-forge --name yourenvname pygithub
import os
import csv
@csmoore
csmoore / ExportGDBSubTypesToFolder.py
Last active July 11, 2020 05:35
Exports all GDB SubTypes from a Military Features GDB to a set of csvs using ArcGIS Desktop/arcpy
# ----------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@csmoore
csmoore / ExportGDBFieldsToFolder.py
Created August 24, 2015 21:30
Exports all fields and field properties from an ArcGIS GDB as a set of csvs
# ----------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@csmoore
csmoore / AddFeatureClassFieldsFromCsv.py
Created August 24, 2015 16:17
Reads a csv with the ArcGIS Feature Class field specifications and adds those fields to the selected Feature Class (with "AddField" GP Tool)
#-------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@csmoore
csmoore / XsdValidateTest
Created June 12, 2015 14:43
Simplest C# XSD Validator - console app to test validation
using System;
using System.Xml;
using System.Xml.Schema;
namespace ValidationTests
{
class Program
{
static void Main(string[] args)
{