Skip to content

Instantly share code, notes, and snippets.

View latkin's full-sized avatar

Lincoln Atkinson latkin

View GitHub Profile
@latkin
latkin / keybase.md
Created September 9, 2017 22:40
keybase.md

Keybase proof

I hereby claim:

  • I am latkin on github.
  • I am latkin (https://keybase.io/latkin) on keybase.
  • I have a public key ASCflg_ClIWLE2q9NWAhQHrj7HkQGqf0na2Msud4uTsV6Ao

To claim this, I am signing this object:

@latkin
latkin / regexinfo.ps1
Last active April 1, 2022 01:43
Regex matching helper
<#
Dumps capture group locations and names/numbers
Example:
> regexinfo 'Jenny: 555-867-5309' '(?<name>\w+):\s+(?<phone>(?:(?<area>\d{3})-)?(\d{3}-\d{4}))'
[Jenny]: [[555]-[867-5309]]
| || |
| || 1
| |area
| phone
@latkin
latkin / func.ps1
Created October 14, 2017 05:22
PowerShell engine stack overflow
# dot-source this function and try running `f 0`
# It work on Windows in Windows PowerShell and PowerShell Core
# On Mac the powershell process terminates with `Process is terminating due to StackOverflowException. Abort trap: 6`
# programmatically generated by parsing https://www.unicode.org/Public/10.0.0/ucd/LineBreak.txt
function f { param($codepoint)
if(($codepoint -ge 0x0000) -and ($codepoint -le 0x0008)){ 'CM' }
elseif($codepoint -eq 0x0009) { 'BA' }
elseif($codepoint -eq 0x000A) { 'LF' }
elseif(($codepoint -ge 0x000B) -and ($codepoint -le 0x000C)){ 'BK' }