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: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 / 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 / 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 / CreateIISSite
Last active July 25, 2018 20:14 — forked from ifrahim/CreateIISSite
Create IIS Site using Powershell
# The following code will create an IIS site and it associated Application Pool.
# Please note that you will be required to run PS with elevated permissions.
# Visit http://ifrahimblog.wordpress.com/2014/02/26/run-powershell-elevated-permissions-import-iis-module/
# set-executionpolicy unrestricted
Function createIISWebsite {
Param ([string]$Folder, [string]$AppPoolName, [string]$SiteName, [string]$Port)
import-module webadministration
New-Item $Folder -type Directory
@JoshuaCarroll
JoshuaCarroll / script.sql
Created March 29, 2018 22:31
Demonstration of geography types in SQL server. Creates a state, then checks to see if two cities are in that state.
DECLARE @ar geography;
SET @ar = geography::STPolyFromText('POLYGON((-106.5715 31.8659,-106.5042 31.7504,-106.3092 31.6242,-106.2103 31.4638,-106.0181 31.3912,-105.7874 31.1846,-105.5663 31.0012,-105.4015 30.8456,-105.0032 30.6462,-104.8521 30.3847,-104.7437 30.2591,-104.6915 30.0738,-104.6777 29.9169,-104.5679 29.7644,-104.5280 29.6475,-104.4044 29.5603,-104.2067 29.4719,-104.1559 29.3834,-103.9774 29.2948,-103.9128 29.2804,-103.8208 29.2481,-103.5640 29.1378,-103.4692 29.0682,-103.3154 29.0105,-103.1616 28.9601,-103.0957 29.0177,-103.0298 29.1330,-102.8677 29.2157,-102.8979 29.2565,-102.8375 29.3570,-102.8004 29.4898,-102.7002 29.6881,-102.5134 29.7691,-102.3843 29.7596,-102.3047 29.8788,-102.1509 29.7834,-101.7004 29.7572,-101.4917 29.7644,-101.2939 29.6308,-101.2582 29.5269,-101.0056 29.3642,-100.9204 29.3056,-100.7707 29.1642,-100.7007 29.0946,-100.6306 28.9012,-100.4974 28.6593,-100.3601 28.4675,-100.2969 28.2778,-100.1733 28.1882,-100.0195 28.0526,-99.9344 27.9435,-99.8438 27.7638,-99.7119 27.6641,-9
@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 / 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 / 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 / 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,-