Skip to content

Instantly share code, notes, and snippets.

algonzalez / RegexPatterns.cs
Created August 21, 2023 20:55
SSN Validation Regex
public class RegexPatterns
/// <summary>
/// Regular expression used to validate an US Social Security Number (SSN)
/// formatted as nine-digits with hyphens (###-##-####).
/// </summary>
/// <example>
/// <code>
/// var ssnRegex = new Regex(RegexPatterns.Ssn);
/// ssnRegex.IsMatch("078-05-1120"); // should return false
editor = \"C:\\Users\\Alberto.Gonzalez\\tools\\VSCode\\Code.exe\" --wait
tool = winmerge
tool = winmerge
[difftool "diffmerge"]
cmd = $USERPROFILE/tools/DiffMerge/sgdm.exe \"$LOCAL\" \"$REMOTE\"
prompt = false
algonzalez / .editorconfig
Last active October 6, 2021 00:53
Basic .editorconfig with some .NET rules
# see for details
# top-most EditorConfig file; stops searching parent directories.
root = true
# Defaults: UTF-8, Windows-style newline,
# 4 space indents,
# newline ending every file,
# trim trailing whitespace
/// <summary>
/// Initial attempt at a simple <see cref="System.Text.Json.Serialization.JsonConverter"/>
/// that handles conversion between objects and interfaces.
/// <p>
/// Appears to fix the loss of interface typed values during serialization,
/// as well as the "Deserialization of interface types is not supported" exception.</p>
/// </summary>
/// <example>
/// // Register the converter with a <see cref="System.Text.Json.JsonSerializerOptions"/> instance:
/// <pre><code>var converter = new ObjectInterfaceJsonConverter&lt;IFoo, Foo&gt;();
algonzalez / git-loglive
Last active March 23, 2021 18:08 — forked from tlberglund/git-loglive
Log Live Git Command
while :
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
algonzalez / ShowWiFiInfo.bat
Created February 17, 2015 16:20
Current Wi-Fi connection Info
rem display current Wi-Fi connection info including SSID
netsh wlan show interface
rem display more details of current Wi-Fi connection
rem NOTE: replace {SSID} with value from found with previous command
netsh wlan show profiles name={SSID}
rem same as above, but includes the password
netsh wlan show profiles name={SSID} key=clear
algonzalez / vs.config.usingWinMerge
Last active August 29, 2015 14:14
Configure Visual Studio User Tools to use WinMerge
// To Compare
Extensions: .*
Operation: Compare
Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe
Arguments: /maximize /e /u /wl /dl %6 /dr %7 %1 %2
// To Merge
Extensions: .*
Operation: Merge
Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe
algonzalez / CloneFromTfsToGit.cmd
Created January 28, 2015 20:43
Using Git-TF to clone a project from TFS to Git
rem Git-TF can be found here
rem call "{path to git-tf}\git-tf help clone" for available command options
{path to git-tf}\git-tf clone {project collection URL} {project path to be cloned} {target directory for clone} --deep --no-tag
rem example:
rem git-tf clone http://tfs:8080/tfs/DefaultCollection $/some_project c:\dev\some_project.git --deep --no-tag
rem -----
rem alternative: see
algonzalez / git.gitignore.forEmptyFiles
Last active August 29, 2015 14:14
Place this ".gitignore" file in an empty directory so that it will be tracked with the project but don't want any other files in the directory to be tracked.
# ignore all files in this directory
# except for these files
# and except nested directories (remove if no sub-dirs should be tracked)