Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Teaching others how to code 👩‍💻 and debug 🐛

Lexie Crawford lexcraw4d

💻
Teaching others how to code 👩‍💻 and debug 🐛
View GitHub Profile
@lexcraw4d
lexcraw4d / espn-api-list.md
Created Oct 28, 2022 — forked from nntrn/espn-api-list.md
list of nfl api endpoints from espn
View espn-api-list.md

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 Jul 14, 2021
Binary Search Algorithm
View binaryalgo.txt
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 Jul 14, 2021
Regex - breaking down email example
View regexemail.md

/^([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