Skip to content

Instantly share code, notes, and snippets.

@csmoore
csmoore / GitCheatSheet.md
Last active July 23, 2020 23:39
Git Cheat Sheet - list of git commands & examples

Just a list of git commands & examples

CLONE A REPO

git clone

CHECK REPO STATUS

git status

Remotes / Remote Merges

View Remotes

@csmoore
csmoore / Excel formulae samples
Last active August 29, 2015 14:22
Obscure Excel formulas I can never remember
Cell contains substring?
=ISNUMBER(SEARCH("NEW_AT_2525D",E2))
Compare if the same string:
=IF(VLOOKUP(B1,B:B,1)=B2,"True","False")
Count occurences:
=SUMPRODUCT(--(ISNUMBER(SEARCH("String",A:A))))
@csmoore
csmoore / FindAndReplaceString
Created April 3, 2015 16:06
Simple find and replace string in files (recursive) python script
#------------------------------------------------------------------------------
# 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 / urlChecker.py
Created January 29, 2015 16:12
Simple, focused link checker that outputs to csv
#-------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# See the license for details but you know the general guidance: this is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#-------------------------------------------------------------------------------
# Name: urlChecker.py
# Usage: python.exe urlChecker.py [Output File:(.csv)] [Directory To Check] [File Filters(default:".html,.erb")]
# Requirements/Constraints: Must run with Python 2.X (because of use of urllib2)
#-------------------------------------------------------------------------------
# Description: a URL Checking script
@csmoore
csmoore / MilitaryFeatureCsvToRuntimeMessage.py
Last active August 29, 2015 14:07
MilitaryFeatureCsvToRuntimeMessage.py
# MilitaryFeatureCsvToRuntimeMessage.py
import csv
import os
import sys
import uuid
### Params:
### 1 - CSV File (.csv)
### 2 - Message File (.xml)
@csmoore
csmoore / ArrowAxisTestMessages
Created September 25, 2014 13:54
ArcGIS Runtime Sample 2525C Messages with Arrows and Control Points
<messages>
<message>
<_type>position_report</_type>
<_action>update</_action>
<_id>005337d7-981d-4137-b03e-6663a8f325ef</_id>
<_wkid>3857</_wkid>
<sic>GFGPOLAV-------</sic>
<_control_points>-227673.83247,6409548.39442;-230125.30147,6578445.28904;-237000,6420000</_control_points>
<uniquedesignation>AXIS 1</uniquedesignation>
</message>
import csv
# Python Simple csv writer/reader snippets
# NOTE: "rb" "wb" is important csv needs these to be opened in "binary" format
###################################################
# csv writer snippet
@csmoore
csmoore / CsvSymbolLookupSample.java
Created June 10, 2014 14:37
Sample SymbolLookup & Loader Class
/*
| 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 / QueryPerformanceCounterExample.cpp
Created May 29, 2014 20:07
Simple example of QueryPerformanceCounter Usage
// If needed #include Winbase.h - link: Kernel32.lib
double PCFreq = 0.0;
LONGLONG CounterStart = 0;
void StartCounter()
{
LARGE_INTEGER li;
if (!QueryPerformanceFrequency(&li))
cout << "QueryPerformanceFrequency failed!\n";
@csmoore
csmoore / CsvSetComparer.py
Created May 5, 2014 14:16
Brute force set comparison of 2 .csv's
#-------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# See the license for details but you know the general guidance: this is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#-------------------------------------------------------------------------------
# Name: CsvSetComparer.py
# Usage: python.exe CsvSetComparer.py [Input File:"Truth"(.csv)] [Input File:"Test"(.csv)]
# {Output Diff File (.csv)="diffs.csv"} {ColumnsToCompare=cols}
# Description: *Brute force* set comparison of 2 .csv's for entries in a "Test" csv's columns that
# do not exist in a "Truth" csv's column. Outputs the diffs from "Test" into