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 / Mail.Mil regex
Created April 3, 2013 16:51
This is a regular expression that will validate all email addresses in DISA's enterprise email system (aka "mail.mil").
((.*?(\.).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil))|(.*?(\.)(([a-z])(\.)).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil)))
@JoshuaCarroll
JoshuaCarroll / AKO email RegEx
Created April 3, 2013 16:53
This regular expression will validate any Army Knowledge Online (AKO) email address.
(.*?(\.).*?(@us\.army\.mil))
@JoshuaCarroll
JoshuaCarroll / AKO|Mail.mil email address
Created April 3, 2013 16:54
This regular expression will validate any mail.mil or AKO email address.
((.*?(\.).*?(@us\.army\.mil))|(.*?(\.).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil))|(.*?(\.)(([a-z])(\.)).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil)))
@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 / 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) {
@JoshuaCarroll
JoshuaCarroll / gist:3a8b3dfd4829c15f17538a77b0e3bf9f
Created August 22, 2016 01:20 — forked from minkymorgan/gist:4702013
setup mysql on a raspberryPI
## shell commands I used to setup mysql on my raspberryPI and enable SQLyog access to it from my laptop
# install mysql using these instructions
# http://databaseblog.myname.nl/2013/01/how-to-install-mysql-succesfully-on.html
# Verify the MySQL Client was installed
mysql --version
# alter the settings to enable it to be a server on your lan
@JoshuaCarroll
JoshuaCarroll / gist:5b164883b1ce2a9c89025aa46ef609b9
Created August 23, 2016 21:44
Commands to install .Net core on a Mac
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
# Install .NET Core SDK with official installer found here: https://go.microsoft.com/fwlink/?LinkID=809124
sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib
@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 / gist:6b3abb16c883037156a78b816c22c8d3
Created December 31, 2016 17:35
Regular expression for US Amateur Radio Call signs
[AKNWaknw][a-zA-Z]{0,2}[0123456789][a-zA-Z]{1,3}
@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}