Skip to content

Instantly share code, notes, and snippets.

View brett-treweek's full-sized avatar

brett treweek brett-treweek

View GitHub Profile

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@brett-treweek
brett-treweek / Hex-Regex-Tutorial.md
Last active July 4, 2021 10:42
Tutorial on using regex to validate Hexadecimal Color Codes.

Using Regular Expressions to validate Hexadecimal Color Codes in Javascript.

When first introduced to regular expressions (or regex) in programming they may seem confusing and cryptic. Despite this, they are very useful. They allow for fast validation of any string value, and identification of specific string values within code or text. The regex syntax has various 'flavours' across many programming languages, database software and text editors, yet the principles are the same.
Click here for a great resource on Regular Expressions
Click here for a great resource on HEX color codes

Summary

This tutorial will describe a commonly used and useful regex that can validate Hexadecimal Color Codes.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database