Skip to content

Instantly share code, notes, and snippets.

@brambow
brambow / arcpy_data_dictionary.py
Created May 22, 2018 13:58
Create a Data Dictionary for ArcGIS Pro Feature Classes
# generate a data dictionary from an ArcGIS feature class
# tested with ArcGIS Pro/Python3
# Run from command prompt in ArcGIS Pro environment
# Takes 2 arguments: 1) path to feature class 2) path for output CSV file
# Example: python C:\arcpy_data_dictionary.py C:\yourgeodatabase.gdb\featureclassname C:\output.csv
import arcpy
import sys
import csv
@bixb0012
bixb0012 / arcpy_arcmap_modify_layer_symbology_expanded.py
Last active March 29, 2023 22:14
ArcPy (ArcMap): Modify Layer Symbology, Expanded
#!python2
# Example 1a adapted from https://www.reddit.com/r/gis/comments/4rhvhh/map_automation_arcpymapping_make_lyr/
#
# Reference: 1) http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm
# 2) https://docs.python.org/2/library/json.html
import arcpy
import json
lyr = # Layer object, typically from arcpy.mapping.ListLayers (arcpy._mapping.Layer)
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active March 20, 2025 13:24
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

#! /bin/bash
# Usage:
# ./git-move.sh path/to/file/or/dir path/to/destination/repo
echo "creating patch for path ${1}"
git log --name-only --pretty="format:" --follow "${1}" \
| sort -u | \
xargs git log --pretty=email --patch-with-stat --reverse --full-index --binary -m --first-parent -- > "${2}/_patch_" \
&& echo "moving to destination repo at ${2}" \
&& cd "${2}" \
&& echo "applying patch" \
@wizioo
wizioo / gitignore_per_git_branch.md
Last active April 4, 2025 07:46
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@maphew
maphew / Remove-Win10-nag.bat
Last active December 23, 2015 20:47
Implementation of "I Cancelled Microsoft 10 Reservation and uninstalled KB3035583 but Window 10 is still trying to install", http://superuser.com/questions/955444/i-cancelled-microsoft-10-reservation-and-uninstalled-kb3035583-but-window-10-is/
:: --{ Remove-Win10-nag.bat }--
:: http://superuser.com/questions/955444/i-cancelled-microsoft-10-reservation-and-uninstalled-kb3035583-but-window-10-is
:: must be run from elevated command prompt (Run As Administrator)
for %%a in (3035583 3022345 3068708 3075249 3080149 2990214 3012973 2952664 2976978) do (
wusa /uninstall /kb:%%a /norestart /quiet
)
echo Windows Registry Editor Version 5.00 >> "%temp%\disable-win10-upgrade.txt"
echo. >> "%temp%\disable-win10-upgrade.txt"
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade] >> "%temp%\disable-win10-upgrade.txt"
@chimerast
chimerast / e2d3_manifest.xml
Created November 10, 2015 01:42
Manifest file of E2D3 (Id is changed)
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ContentApp">
<Id>00000000-0000-0000-0000-000000000000</Id>
<Version>1.5.0.0</Version>
<ProviderName>e2d3.org</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="E2D3" />
<Description DefaultValue="Dynamic, interactive, and more interesting graphing from your Excel!" />
<IconUrl DefaultValue="http://e2d3.org/wp-content/uploads/2015/05/logo.png" />
<SupportUrl DefaultValue="http://www.e2d3.org/" />
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2015-10-27T04:32:20.2209506</Date>
<Author>localhost\Matt</Author>
<Description>Workaround for the capture service halting on suspend/hibernate and resume (https://github.com/codebox/bitmeteros/issues/30). Fires on Startup (30s delay), Logon and Workstation Unlock.</Description>
</RegistrationInfo>
<Triggers>
<SessionStateChangeTrigger>
<Enabled>true</Enabled>
@lpinner
lpinner / setup.py
Last active April 7, 2016 02:28
Simple usercustomize.py to set up separate site.USER_BASE directories for 32 and 64bit python installs on Windows
from setuptools import setup
long_description = '''Simple usercustomize.py to keep separate site.USER_BASE/USER_SITE directories for 32 and 64bit
python installs on Windows.
Only required if you're installing extension modules (compiled pyd/dll) to the user site-packages directory, i.e.:
python setup.py install --user
pip install --user somepackage
@dieseltravis
dieseltravis / PS-BGInfo.ps1
Last active March 21, 2025 19:16
update wallpaper background image with powershell (like Sysinternals BGInfo)
# PS-BGInfo
# Powershell script that updates the background image with a random image from a folder and writes out system info text to it.
# run as a lower priority task
[System.Threading.Thread]::CurrentThread.Priority = 'BelowNormal'
# Configuration:
# Font Family name
$font="Input"