Skip to content

Instantly share code, notes, and snippets.

View jbrown123's full-sized avatar
💭
Looking for a new opportunity

James Brown jbrown123

💭
Looking for a new opportunity
View GitHub Profile
@jbrown123
jbrown123 / 00 RPTools MapTool create an image table.md
Last active February 1, 2025 00:10
Easily create image tables for RPTools MapTool

RPTools MapTool - Create an image table

Creating an image table in MapTool is tedious, at best, for all but the most trivial tables. I created a perl script to make the process much easier, especially for a large collection of images.

Perl runs on every platform that MapTool runs on so everyone should be able to use this script fairly easily.

What you'll need

To run this on your machine you'll need to have the following installed:

@jbrown123
jbrown123 / 00 RPTools Maptool multi-image tokens.md
Last active January 31, 2025 18:34
RPTools Maptool - create tokens with multiple images

RPTools Maptool multi-image tokens

The process for generating a token with multiple images is somewhat complex, especially if you want a way to access and use those images (like changing your token image on the map). This could be useful for simple cases like having a unique token for each weapon your character wields. It's incredibly useful if you have a shapeshifter or other type of token that needs to be radically different depending on some circumstance.

Resources

I developed this by "standing on the backs of giants" which is to say, I did lots of looking around on the internet, in forums, and in the RPTools documentation. Here are some of the sources of information I gathered from:

@jbrown123
jbrown123 / readme.md
Last active July 7, 2024 21:13
SQLite database for USHCN data

Database to process USHCN data

The U.S. Historical Climatology Network USHCN data are used to quantify national and regional-scale temperature changes in the contiguous United States (CONUS). The dataset provides adjustments for systematic, non-climatic changes that bias temperature trends of monthly temperature records of long-term COOP stations.

USHCN defines these elements as follows:

  • tmax = monthly mean maximum temperature
  • tmin = monthly mean minimum temperature
  • tavg = average monthly temperature (tmax+tmin)/2
  • prcp = total monthly precipitation
@jbrown123
jbrown123 / 00 Include SQLite commands at the top of a data file.md
Last active February 1, 2025 00:16
Include SQLite commands at the top of a data file

Merge SQLITE commands and data in one text file

Frequently it's handy to keep the instructions for importing data and the data itself in the same physical file. The attached script & data is one example. The first line is a SQL comment (starts with --) telling you how to load the file itself. On unix-like systems this could be replaced with a 'shebang' (#!) which SQLite also, conveniently, ignores.

There are a few things to keep in mind.

  • First, you must match the embedded names in the file with the actual file name. Renaming the file will break the SQL at the top that is trying to load the data.
  • Second, you must edit the --skip directive to adjust for any change in commands that you need. For example, if you have more or less fields in your create table command or if you need to add other SQL commands. Note that if you were to import the 'header' line (by doing --skip 11 in this case) it would appear as part of the data since we are importing into an existing table. If you are planning to use t
@jbrown123
jbrown123 / mylib.scad
Created February 9, 2020 22:12
A library of openscad functions that I frequently use in my designs
/*
* MyLib.scad
*
* A bunch of openscad functions that I might need from time to time in various projects
*
* Usage: use <mylib.scad>;
*
* Version: 20200209
*
* Copyright (c) 2011-2020 by James H. Brown
@jbrown123
jbrown123 / uta-wifi.user.js
Created August 15, 2019 14:35
Auto login to UTA (Utah Transit Authority) WiFi - ticks the accept conditions checkbox, then clicks the connect button
// ==UserScript==
// @name Auto login to UTA WiFi
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Check the box and press the button on the UTA wifi page
// @author James Brown
// @match http://utawifi.com/
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
@jbrown123
jbrown123 / AccessGithubWithPuTTY.md
Last active November 4, 2024 14:33
How to use PuTTY with github on Windows

How to use PuTTY with github on Windows

To make things easier, we can tell git to use the PuTTY tools rather than the built in ssh client. The PuTTY tools include an identity manager and an SSH replacement.

Follow these four steps:

  1. Download and install PuTTY using the MSI installer package from the PuTTY download page. Alternately, you can just get the "PLink" and "Pageant" executables from the same page and save them somewhere in your path.

  2. Add a new user or system environment variable:

  • Press Windows+R and enter sysdm.cpl
@jbrown123
jbrown123 / alarmclock.pl
Created March 21, 2019 14:49
A simple recurring alarm clock written in Perl (does not require any packages, just plain perl). This version is specific to Windows but could easily be converted to other platforms.
#!/usr/bin/env perl
#
# a (very simple) recurring alarm clock for windows
# easily converted to any other platform by replacing the call to the windows msg tool
# all data is stored in the file itself (in the __DATA__ section at the bottom)
# this is written in pure perl, no packages are required
#
# under windows I suggest using the ActiveState wperl interpreter to launch the alarm clock
# that prevents you from having a command processor hanging around just to run the alarm clock
# the unfortunate side effect is that you have to kill it using task manager since it never exits
@jbrown123
jbrown123 / unsplash_random.html
Created March 20, 2019 23:27
Unsplash randomly rotating images
<html>
<head>
<title>Unsplash images</title>
<script>
// randomly cycle through unsplash images in the browser window every 5-30 seconds
// this works great in full screen (F11) mode on wall monitors as random artwork
//
// tested on Chrome; should work on most modern browsers but don't blame me if it doesn't
// I used info from the following sites to create this
@jbrown123
jbrown123 / readme.md
Last active August 18, 2024 21:55
Reference bookmarklet - generate a string containing the page title, URL and any selected text

Reference bookmarklet

This bookmarklet will grab 2 or 3 bits of info from the currently viewed webpage and put them into an 'alert' so you can copy & paste into another document.

It should work in any desktop browser (chrome, firefox, ect.) on any OS but I've only personally tested it in Chrome on Windows.

You can press either enter or escape after copying the text. It doesn't make any difference which one you use.

For example, the above URL points to the bookmarklet entry on Wikipedia. If you used the reference bookmarklet on that page it would return the following: