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 / 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 / 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 / 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 / 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 / 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}
Byte Hex value
================
127013 22
127014 19
127015 CF
127016 E8
127017 0
127018 0
127019 2
127020 0
@JoshuaCarroll
JoshuaCarroll / us_state_borders.xml
Created March 29, 2018 01:40
XML of the points of borders of all US states
<states>
<state name ="Alaska" colour="#ff0000" >
<point lat="70.0187" lng="-141.0205"/>
<point lat="70.1292" lng="-141.7291"/>
<point lat="70.4515" lng="-144.8163"/>
<point lat="70.7471" lng="-148.4583"/>
<point lat="70.7923" lng="-151.1609"/>
<point lat="71.1470" lng="-152.6221"/>
<point lat="71.1185" lng="-153.9954"/>
@JoshuaCarroll
JoshuaCarroll / transform.xslt
Created March 29, 2018 01:43
XSL transform to input XML of states and output SQL insert statement
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
<xsl:template match="/states/state">
INSERT INTO States (State, Borders)
VALUES ('<xsl:value-of select="@name"/>', (geography::STGeomFromText('POLYGON((<xsl:for-each select="point"><xsl:value-of select="@lng"/><xsl:text> </xsl:text><xsl:value-of select="@lat"/>,</xsl:for-each><xsl:value-of select="point[1]/@lng"/><xsl:text> </xsl:text><xsl:value-of select="point[1]/@lat"/>))', 4326)));
</xsl:template>
</xsl:stylesheet>
@JoshuaCarroll
JoshuaCarroll / insertStates.sql
Last active March 29, 2018 20:49
SQL to insert geography of the borders of all US states as a polygon
CREATE TABLE dbo.States (
State varchar(20) NOT NULL,
CoordinatorEmail varchar(255) NULL,
Borders geography(-1) NULL
);
INSERT INTO States (State, Borders)
VALUES ('Alaska', (geography::STGeomFromText('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,-