Skip to content

Instantly share code, notes, and snippets.

View boxpositron's full-sized avatar
🎯
Focusing

David Ibia boxpositron

🎯
Focusing
View GitHub Profile
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active June 28, 2022 07:16
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'firstname.lastname@gov.bc.ca'
    
@michaelkeevildown
michaelkeevildown / credit-card-regex.md
Last active April 17, 2024 20:36
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 19, 2024 12:30
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@silvasur
silvasur / tetris.py
Last active January 22, 2024 21:49
Tetris implementation in Python
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Very simple tetris implementation
#
# Control keys:
# Down - Drop stone faster
# Left/Right - Move stone
# Up - Rotate Stone clockwise
# Escape - Quit game