Skip to content

Instantly share code, notes, and snippets.

@maphew
maphew / Marsh_Lake_set_points.gpx
Created July 13, 2015 17:23
Output from GPX_to_Features.py (https://github.com/maphew/arcgiscom_tools). Garmin BaseCamp fails to read it.
<?xml version='1.0' encoding='UTF-8'?>
<gpx creator="Esri" version="1.0" xalan="http://xml.apache.org/xalan" xmlns="http://www.topografix.com/GPX/1/1" xsi="http://www.w3.org/2001/XMLSchema-instance"><wpt lat="60.3275172608" lon="-134.272101215"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.5452343323" lon="-134.416443469"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.5059909227" lon="-134.380400689"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.5351046022" lon="-134.492167512"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.4470025183" lon="-134.278019165"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.4715259816" lon="-134.328562126"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.4380733513" lon="-134.309640075"><ele>0</ele><time> </time><name> </name><desc> </desc></wpt><wpt lat="60.5258212849" lon="-134.428693475"><ele>0</ele><time> </time><name> </na
@maphew
maphew / nts_map_as_html_table.py
Last active August 29, 2015 14:27
Print Yukon NTS tile names as html table with links, arranged in same order as they appear in a map index. See rendered result: https://cdn.rawgit.com/maphew/8f2f0ccb721cacea1b33/raw/868744229e6c2234d94cbc369ab18d486de61474/nts_html_table.html
''' Print Yukon NTS tile names as html table with links, arranged in same order as they appear in a map index.
2015-Aug-19, Matt.Wilkie@gov.yk.ca
License: X/MIT
'''
nts_txt_ordered = '''117C 117D
117B 117A
116NO 116P
116JK 116I 106L 106K
@maphew
maphew / flash-autoupdate.bat
Last active August 29, 2015 14:27 — forked from karlhorky/flash-autoupdate.bat
Trigger Adobe Flash Player Auto-Update mechanism on Windows
:: On-Demand Flash Autoupdate
:: Author: Karl Horky
:: Date: 22 June 2012
:: Version: 0.2
:: Homepage: http://www.karlhorky.com/2012/06/manually-run-autoupdate-for-adobe-flash.html
@echo off
pushd C:\Windows\System32\Macromed\Flash\
if exist *ActiveX.exe (
echo Updating Flash Player Plugin for Internet Explorer
<?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>
@maphew
maphew / create_hardlink.py
Last active December 16, 2015 06:19
Create file hardlinks in python in a platform independent way. [untested] Courtesy of Dieter Deyke, http://www.gossamer-threads.com/lists/python/python/517542#517542
@maphew
maphew / install-pip.py
Last active December 16, 2015 06:49
A pure python script to download and install the distribute_setup and pip utilities. Tested on Windows 7, Python 3.2.
"""
pip-install.py
A pure python script to download and install the distribute_setup and
pip utilities
Adapted from:
http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows/15294806#15294806
http://stackoverflow.com/questions/2792650/python3-error-import-error-no-module-name-urllib
http://stackoverflow.com/questions/1093322/how-do-i-check-what-version-of-python-is-running-my-script
@maphew
maphew / Run Elevated.xml
Last active December 18, 2015 05:39
An experimental Leo button which executes the currently selected node as a python script after invoking User Account Control (UAC). Not fully functional yet -- and dangerous. You could easily bork all your data or even your computer with this: it runs code with admin privileges, no sanity checking, and very limited feedback. Tracebacks etc. are …
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by Leo (http://webpages.charter.net/edreamleo/front.html) -->
<?xml-stylesheet ekr_test?>
<leo_file xmlns:leo="http://www.leo-editor.org/2011/leo" >
<leo_header file_format="2"/>
<vnodes>
<v t="maphew.20130607222534.1739" a="E"><vh>@button Run Elevated</vh>
<v t="maphew.20130608014320.1983"><vh>docstring</vh></v>
<v t="maphew.20130608014320.1743"><vh>imports</vh></v>
<v t="maphew.20130608014320.1744"><vh>Leo preparation</vh></v>
@maphew
maphew / RunElevated-test.xml
Created June 10, 2013 07:36
a test node for Run Elevated leo button script -- https://gist.github.com/maphew/5734699
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by Leo (http://webpages.charter.net/edreamleo/front.html) -->
<?xml-stylesheet ekr_test?>
<leo_file xmlns:leo="http://www.leo-editor.org/2011/leo" >
<leo_header file_format="2"/>
<vnodes>
<v t="maphew.20130608014320.1741"><vh>Run Elevated test</vh></v>
</vnodes>
<tnodes>
<t tx="maphew.20130608014320.1741">import os, sys
@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"