Skip to content

Instantly share code, notes, and snippets.

# Compose a street map and weather radar into an image.
#
# Map GIS export from ArcGIS. Query f=html to view a sample exported image and form to tweak parameters.
# https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/export?bbox=-15165054.230000%2C2294608.041000%2C-6778397.876000%2C6947666.110000&bboxSR=&layers=&layerDefs=&size=3440%2C1440&imageSR=102100&format=png32&transparent=false&dpi=&time=&layerTimeOptions=&dynamicLayers=&gdbVersion=&mapScale=&rotation=&datumTransformations=&layerParameterValues=&mapRangeValues=&layerRangeValues=&f=html
#
# Radar GIS export from NOAA.
# https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Observations/radar_base_reflectivity/MapServer/export?bbox=-15165054.230000%2C2294608.041000%2C-6778397.876000%2C6947666.110000&bboxSR=&layers=&layerDefs=&size=3440%2C1440&imageSR=102100&format=png32&transparent=true&dpi=&time=&layerTimeOptions=&dynamicLayers=&gdbVersion=&mapScale=&rotation=&datumTransformations=&layerParameterValues=&mapRangeValues=&laye
@shoover
shoover / putty-reg.rb
Last active March 22, 2019 14:07
Ruby script to paint over Putty session registry settings from data
require 'win32/registry'
# Enumerate Putty sessions. blk: (reg, session name).
def each_session(&blk)
Win32::Registry::HKEY_CURRENT_USER.open('Software\SimonTatham\PuTTY\Sessions') do |reg|
reg.each_key do |key|
reg.open(key, Win32::Registry::Constants::KEY_WRITE) do |session|
yield session, key
end
end
@shoover
shoover / NextWindow.ahk
Last active January 12, 2018 19:18
AutoHotKey NextWindow function using window class and IVirtualDesktopManager
; Activate the next window in the same window class and virtual desktop.
; This works by searching windows by ahk_cls.
NextWindow()
{
; Get the active window class
WinGetClass cls, A
; Sometimes the active window class is blank when a Chrome tab is loading.
if !RegExMatch(cls, "[^\s]")
return
# Converts changesets bidirectionally between two repos, presumably between a
# subdirectory in a main repo and a separate project repo. The hg convert
# extension is used once in each direction. The convert extension's shamaps
# are tracked, so you need two of them plus two filemaps to map the file names
# between repos.
#
# Required args are paths and revisions for each repo. Revs are required to avoid
# syncing unwanted branches.
#
# An optional name is used as a suffix for all the map files. It defaults to
@shoover
shoover / csx.rb
Last active August 29, 2015 14:19
A hacky C# script compiler runner
# C# script compiler and runner
#
# Hash headers at the top can be used to override default csc options. This is
# mainly for specifying references, but you can pass anything csc.exe takes.
# Extra plain .cs files should work if you put them last.
#
# References are tricky because practically they have to be in the application
# directory, which we stash away in HOME/.csx/something. Any reference csx can
# find (relative to the working directory) it will copy, which should work.
#
#!/bin/bash -e
#
# Purpose: Pack a Chromium extension directory into crx format
# From https://developer.chrome.com/extensions/crx#scripts, modified to take
# an output file argument.
if test $# -ne 3; then
echo "Usage: crxmake.sh <extension dir> <pem path> <crx out>"
exit 1
fi
# Exports all .org files in argument dirs as HTML.
#
# Usage: rake -f export-org-dirs.rb DIR+ [sync_mobile]
#
# sync_mobile (if not a dir) will fire off org-mobile-push and -pull if the
# mobile index is out of date wrt org files in dirs. This happens in the
# server so it saves your work and updates locally instead of behind your back
# and demanding a revert. It is advised to set this up to run only when the
# computer is idle so it doesn't go crazy while you're editing.
#
@shoover
shoover / chromes.vbs
Created June 20, 2013 20:12
Load a URL in Chrome as a new tab in a specific user profile's window
' Load a URL in Chrome as a new tab in a specific user profile's window.
' usage: chromes PROFILE [URL]
' PROFILE can be a keyword to be translated in the lookup below.
Set oShell = CreateObject ("Wscript.Shell")
Dim profile, url, cmd, args
profile = WScript.Arguments(0)
Select Case LCase(profile)
@shoover
shoover / MarshalAction.cs
Created November 3, 2010 13:13
wraps an action in an asynchronous Post on the current synchronization context
// usage:
// // In a UI event handler:
// BarAsync(result => label.Text = result);
//
// void BarAsync(Action<int> completed) {
// completed = completed.Marshal();
// ThreadPool.QueueUserWorkItem(() => completed(42));
// }
//
// Here's what it replaces. You'd need one of these for each delegate type
diff --git a/src/main/java/com/theoryinpractise/clojure/ClojureSwankMojo.java b/src/main/java/com/theoryinpractise/clojure/ClojureSwankMojo.java
index d792b10..7fb29b9 100644
--- a/src/main/java/com/theoryinpractise/clojure/ClojureSwankMojo.java
+++ b/src/main/java/com/theoryinpractise/clojure/ClojureSwankMojo.java
@@ -62,13 +62,13 @@ public class ClojureSwankMojo extends AbstractClojureCompilerMojo {
StringBuilder sb = new StringBuilder();
sb.append("(do ");
- sb.append("(swank.swank/start-server \"");
- sb.append(swankTempFile.getAbsolutePath());