Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lexcraw4d's full-sized avatar
💻
Teaching others how to code 👩‍💻 and debug 🐛

Lexie Crawford lexcraw4d

💻
Teaching others how to code 👩‍💻 and debug 🐛
View GitHub Profile
@lexcraw4d
lexcraw4d / tooltip.css
Created October 5, 2023 06:31
Salesforce Custom Tooltip LWC for helptext information
/* tooltip.css */
.container {
position: relative;
}
.help-icon {
cursor: pointer;
position: relative;
margin-left: 5px;
@lexcraw4d
lexcraw4d / espn-api-list.md
Created October 28, 2022 14:59 — forked from nntrn/espn-api-list.md
list of nfl api endpoints from espn

List of NFL API Endpoints

View updated list here

This page is limited to NFL endpoints but can be refashioned for other sports leagues (i.e. /sports/football/leagues/nfl/ => /sports/baseball/leagues/mlb/)


Getting started

@lexcraw4d
lexcraw4d / binaryalgo.txt
Created July 14, 2021 05:01
Binary Search Algorithm
const data = [12, 23, 38, 40, 54, 62, 71, 87, 99];
const binarySearch = (arr, num, left, right) => {
let middle = Math.floor((left + right) / 2);
// range overlapped, so never found number
if (left > right) {
return -1;
}
else if (num === arr[middle]) {
@lexcraw4d
lexcraw4d / regexemail.md
Created July 14, 2021 03:25
Regex - breaking down email example

/^([a-z0-9_.-]+)@([\da-z.-]+).([a-z.]{2,6})$/

Now that we have a general idea how Regex works (visit my simple Regex tutorial). Let's break down what's happening in the Email Regex example above.

The anchor used in this regex for email is the ^, which indicates the beginning of a string and the $, indicating the end of a string. Next, lets focus our attention to the (grouping/capturing which occurs between parenthesis). In group one, (remember group zero is the whole entity together as one) we see ([a-z0-9_\.-]). This matches the email name. Furthermore, we can tell because inside the brackets, it is matching any character in the range "a" to "z", any digits 0-9, underscore character which matches _ , the \ indicates an excape matching a . , and last the - character matching a -. Next, we noticed what every email has the @ symbol, which means without this matching, it wouldn't be an email! We move to