Skip to content

Instantly share code, notes, and snippets.

Matthew Cantelon mattcan

Block or report user

Report or block mattcan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mattcan /
Last active May 8, 2018
My Keybase proof, if it wasn't clear.

Keybase proof

I hereby claim:

  • I am mattcan on github.
  • I am mattcan ( on keybase.
  • I have a public key ASCN7XUd8jQvMW1xW91fHqqB17fMV3-2uBZZ_ySs63KzAAo

To claim this, I am signing this object:

mattcan / setcodes.json
Created Sep 5, 2016
Pokemon Trading Card Game Online (PTCGO) set code to TCG set code
View setcodes.json
"sets": {
"HS": "hgss1",
"UL": "hgss2",
"UD": "hgss3",
"TM": "hgss4",
"CL": "col1",
"PR-BLW": "bwp",
"BLW": "bw1",
"EPO": "bw2",
mattcan / gist:a068df4d0f4ccea84f720eec4b22d6bb
Created Jun 9, 2016
So I don't go insane deploying to iis again
View gist:a068df4d0f4ccea84f720eec4b22d6bb
* Application should NOT point to wwwroot, just the root folder
* webconfig setup in above link is key
* ApplicationPoolIdentity for app pool
mattcan /
Created Mar 21, 2016
Regex Searches for Visual Studio
  • Finding Response.Redirect where only one parameter is used (this is imperfect)

mattcan / GRANT.sql
Created Oct 6, 2015
Setting execute on a schema in SQL Server tends to evade my memory
View GRANT.sql
GRANT EXECUTE ON SCHEMA :: <schema here> TO <user/role here>;

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.


Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 28/10/2014
  • Original post

mattcan / StringFormat.vb
Last active Dec 15, 2015
Works similar to String.Format in .NET. Takes in a string and fills in the {n} variables.
View StringFormat.vb
' Needs error checking and to handle more than just strings
' Usage:
' StringFormat("My {2} dogs are {0}, {3}, and {1}.", "Dumbo", "Tim", "3", "Marsha")
Function StringFormat(ByVal ParseTemplate As String, ByVal Arg As String, ParamArray Args() As Variant) As String
Dim lastItemIndex As Integer, combinedArgs() As Variant
' Combine the passed in arguments
If Not UBound(Args) < LBound(Args) Then
ReDim combinedArgs(0 To UBound(Args) + 1)
mattcan / TextStreamFactory.bas
Last active Dec 11, 2015
I always forget how to create a new text file so I put together this factory. You will need to reference the Microsoft Scripting Runtime library in your VBA project.
View TextStreamFactory.bas
' Make sure you've referenced the Microsoft Scripting Runtime library in your project
' In the VBA Editor: Tools > References...
Function TextStreamFactory(ByVal NewFileName As String) As Scripting.TextStream
Dim fs As New Scripting.FileSystemObject
Dim ts As Scripting.TextStream
Set ts = fs.CreateTextFile(NewFileName)
Set TextStreamFactory = ts
End Function
mattcan / FindValue.vb
Last active Oct 14, 2015
Takes the name of a field in a string, the character after the value, and returns the value in an adjacent column. I used this to parse a few hundred URLs for the value of the username.
View FindValue.vb
Sub FindValue()
Dim ws As Excel.Worksheet
Set ws = ActiveSheet
Dim i As Integer, lastRow As Integer
lastRow = 328
Dim fromCol As String, toCol As String, field As String, delim As String
fromCol = "C"
You can’t perform that action at this time.