Skip to content

Instantly share code, notes, and snippets.

@maphew
maphew / Install-Leo-code-download.cmd
Last active October 16, 2023 04:43
**Install Leo on Windows Recipe**. Choose among the .cmd for installing from code download, using git, or pypi release. The last one, `Install-Leo`, has all 3 in one file, so don't run as is.
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
@maphew
maphew / 8-Stitches.md
Last active May 18, 2023 07:00
8 Stitches

"Only the woman is wearing complete protective gear."

An observation my wife makes while we watch the [Bridge Breaking Competition][0]. A dozen engineers mill about, loading metal weights into buckets, and measuring when the popsicle sticks and dental floss contraptions slide, blow and explode into constituent pieces to the oohs and ahs of the delighted and dismayed onlooking crowd of grade school students and families. All of the engineers wear glasses, a few sport steel toed boots, though most have sneakers, and two hard hats are in attendance.

"Oh. That's interesting." says me, and softly led the thought to the background, there being more interesting things to think about. Crack! Crash! and another broken bridge suffers catastrophic ignomy and flies into pieces to the waiting floor and bucket. "Oh wow, that one supported 72kg!"

Applause. We leave. Time passes. Life goes on.

Four hours later I'm sitting in the emergency room clutching a fileted finger and cycling through alternating turns of waiting,

@maphew
maphew / add-arc-lm-firewall.bat
Last active February 14, 2023 18:25
Allow ArcGIS License Manager through the firewall
@echo off
:: Run this on the LM server machine
setlocal
set _p=C:\ArcGIS\License_Manager\LicenseManager\bin
:inbound
netsh advfirewall firewall add rule name="ArcGIS License Manager - arcgis" dir=in action=allow program="%_p%\arcgis.exe" enable=yes
netsh advfirewall firewall add rule name="ArcGIS License Manager - lmgrd" dir=in action=allow program="%_p%\lmgrd.exe" enable=yes
netsh advfirewall firewall add rule name="ArcGIS License Manager - LSA" dir=in action=allow program="%_p%\LSA.exe" enable=yes
@paniq
paniq / BAG.md
Last active July 8, 2023 07:42
.bag File Format

The .bag File Format

A .bag file (short for "Blobby/Binary/Boxed/Bagged Atom Graph") file describes a directed graph of atoms, which can be either blob (array of bytes) or cell (array of atoms) in topological order of ownership, leaves first, root last. This renders the format particularly append/overlay-friendly, as the root can be rewritten without changing the existing file or removing unused nodes.

.bag is comparable to RIFF in scope but fixes two major problems with it, namely that RIFF can only encode trees and isn't topologically ordered, requiring the use of a stack when reading it.

The format can be read as a binary stream of 64-bit words. It begins with the magic 4-character sequence .bag and a 32-bit version which must be 1 (hence .bag\x01\0\0\0 or 0x000000016761622e), and is then only followed by atoms until the file ends.

An atom begins with a header word, followed by its contents, aligned t

@maphew
maphew / PS-BGInfo.ps1
Created April 27, 2022 20:38 — forked from dieseltravis/PS-BGInfo.ps1
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"

Pansharpening notes, mid-2021

First posted in August 2021. This is basically a snapshot of my thinking about pansharpening at that time; I’m not making any substantial updates. Last typo and clarity fixes in February 2023.

Preface

This is a collection of notes on how I’ve been approaching convolutional neural networks for pansharpening. It’s an edited version of an e-mail to a friend who had asked about this tweet, so it’s informal and somewhat silly; it’s not as polished as, say, a blog post would be. It’s basically the advice I would give to an image processing hobbyist before they started working on pansharpening.

If you want a more serious introduction, start with the literature review in Learning deep multiresolution representations for pansharpening. Most of the academic work I would recommend is mentioned there.

@maphew
maphew / make-yt-nts-index-html-table.py
Created November 13, 2020 05:29
Yukon NTS Index in various formats
'''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
@idelem
idelem / titleUrlMarkdownClip.js
Last active March 12, 2024 02:01 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@maphew
maphew / outlook-taskboard-config.json
Created September 22, 2020 23:25
Outlook-taskboard config with To-Do flagged emails enabled and shown in BACKLOG lane
{
"BACKLOG_FOLDER": {
"ACTIVE": true,
"NAME": "",
"TITLE": "BACKLOG",
"SORT": "-priority,duedate,categoryNames,subject",
"RESTRICT": "",
"DISPLAY_PROPERTIES": {
"OWNER": false,
"PERCENT": false,
@maphew
maphew / History Tracer.xml
Last active July 11, 2020 08:23
WIP: management scripts for History Tracer plugin for Leo
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by Leo: http://leoeditor.com/leo_toc.html -->
<leo_file xmlns:leo="http://leoeditor.com/namespaces/leo-python-editor/1.1" >
<leo_header file_format="2"/>
<vnodes>
<v t="mhw.20200710235109.1"><vh>History Tracer</vh>
<v t="mhw.20200308223025.1"><vh>@int history-tracer-port=8088</vh></v>
<v t="mhw.20200710235122.1"><vh>@button leo-ver-serv-start</vh></v>
<v t="mhw.20200710235134.1"><vh>@button leo-ver-serv-list</vh></v>
<v t="mhw.20200710235410.1"><vh>@button leo-ver-serv-stop</vh></v>