Skip to content

Instantly share code, notes, and snippets.

View JoshuaCarroll's full-sized avatar
🏈
Scoreboards, scorebugs, SDK's, etc

Joshua Carroll JoshuaCarroll

🏈
Scoreboards, scorebugs, SDK's, etc
View GitHub Profile
@JoshuaCarroll
JoshuaCarroll / gist:f6b2c64992dfe23feed49a117f5d1a43
Last active November 6, 2023 22:25
Regular expression (regex) for non-US amateur radio call signs
All amateur radio call signs:
[a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z]
Non-US call signs:
\b(?!K)(?!k)(?!N)(?!n)(?!W)(?!w)(?!A[A-L])(?!a[a-l])[a-zA-Z0-9][a-zA-Z0-9]?[a-zA-Z0-9]?[0-9][a-zA-Z0-9][a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]?\b
US call signs:
[AKNWaknw][a-zA-Z]{0,2}[0-9][a-zA-Z]{1,3}
@JoshuaCarroll
JoshuaCarroll / wkt_all_states.txt
Created March 29, 2018 02:07
WKT polygons of all US states' borders
Alaska
POLYGON((-141.0205 70.0187,-141.7291 70.1292,-144.8163 70.4515,-148.4583 70.7471,-151.1609 70.7923,-152.6221 71.1470,-153.9954 71.1185,-154.8853 71.4307,-156.7529 71.5232,-157.9449 71.2796,-159.6313 71.2249,-161.8671 70.6363,-163.5809 70.0843,-165.2399 69.3028,-166.8768 69.1782,-168.0414 68.3344,-165.9155 67.6844,-164.6082 67.2933,-164.0149 66.7789,-165.7507 66.5810,-167.5745 66.2867,-168.9862 66.0269,-168.9478 65.4970,-167.4756 65.0420,-167.0142 64.3922,-165.7343 64.0554,-163.2294 64.0193,-162.1143 63.9615,-163.6029 63.6877,-165.3717 63.4530,-166.3715 62.4133,-166.9867 61.6534,-166.4429 60.8556,-167.8381 60.5357,-167.7118 59.5482,-165.8002 59.4115,-164.5972 59.3696,-162.8558 59.1168,-162.5427 58.1185,-160.6421 58.1359,-159.5050 58.0285,-158.8953 57.6336,-159.9060 56.9090,-160.6531 56.3926,-161.8835 56.2342,-162.9822 55.7240,-164.3994 55.2478,-165.3168 54.7753,-167.1075 54.1463,-168.5852 53.5632,-169.9146 53.1402,-169.5959 52.5964,-168.2227 52.9089,-162.7734 54.2139,-159.1452 54.6786,-155.4634 55.656
@JoshuaCarroll
JoshuaCarroll / statesAndCounties.js
Last active September 22, 2023 12:41
JavaScript array of all US states and counties
function County(strState, strCountyName) {
this.state = strState;
this.countyName = strCountyName;
}
var arrStates = new Array("AK","AL","AR","AZ","CA","CO","CT","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY", "OH","OK","OR","PA","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY");
var arrCounties = new Array(
new County("AL","Autauga County"),
@JoshuaCarroll
JoshuaCarroll / RunNgrokAsServicePi.md
Created April 22, 2019 16:27
How to run ngrok as a service on a Raspberry Pi

First install screen sudo apt install screen

Now you could just run it screen -d -m ./ngrok http 80

But you probably want it to automatically run at startup. So edit the bashrc: sudo nano /home/pi/.bashrc

Scroll to the very end of that file and add this:

@JoshuaCarroll
JoshuaCarroll / gist:b11a6f16ba40f1e11dcef92c90dcf8e5
Last active February 27, 2021 15:11
Regular expression for APRS telemetry data
([a-zA-Z0-9]{1,3}[0123456789][a-zA-Z0-9]{0,3}[a-zA-Z].*)>.*:T\#(...),(...),(...),(...),(...),(...),(........)
@JoshuaCarroll
JoshuaCarroll / Convert Base 32 to decimal
Last active December 10, 2020 01:21
This console application shows how to convert Base 32 numbers to decimal.
// Huge thanks to my friend Ben Andrews for writing a version of this in Java. Rewriting it in C# was a
// walk in the park after your work.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Base32Convertor
@JoshuaCarroll
JoshuaCarroll / cardMagStripe.regex
Created August 2, 2017 21:48
Regular expression for validating and parsing credit/debit card magnetic stripe data
^%B([0-9]{1,19})\^(.*?)\^([0-9]{1,4})([0-9]{1,3})(.*?)\?.*?;([0-9]{1,19})=([0-9]{1,4})([0-9]{1,3}).*?\?(.*?)
@JoshuaCarroll
JoshuaCarroll / PA Staff List.regex
Created March 24, 2019 22:32
RegEx for PA staff list from Veracross
(.\n)?((.*)\n)?((.*)\n)?(WORK\n(\d{3}\D?\D?\d{3}\D?\d{4})\n)?(EMAIL\n([a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)\n)?
@JoshuaCarroll
JoshuaCarroll / latlon.regex
Created January 20, 2019 22:48
Latitude / Longitude regular expression
([-+]?(?:[0-9]|[1-9][0-9])\.\d+),\s*([-+]?(?:[0-9]|[1-9][0-9]|[1-9][0-9][0-9])\.\d+)
@JoshuaCarroll
JoshuaCarroll / DispenseChecker.java
Created January 15, 2015 03:13
Given money denominations and a desired amount to withdrawal, determine if the amount can be withdrawn using the bills available.
public class DispenseChecker {
public static void main(String[] args) {
// Setup a sample run. This bank's ATMs typically have 20's, 50's, 100's and 500's
int[] intNotes = {500, 100, 50, 20};
// Check every amount between 0 and 1000 incrementally by 10 to see if the ATM could dispense that amount.
// Display the amounts that can't be dispensed.
for (int i = 0; i <= 1000; i = i + 10) {