This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"For Items Loop": { | |
"prefix": "for items", | |
"body": [ | |
"for items in ${TM_SELECTED_TEXT:$1}:", | |
" print(f'${TM_SELECTED_TEXT:$1} Item: {items}')" | |
], | |
"description": "For Items Loop" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def slugFinder(urlString): | |
slashSplit = urlString.split('/') | |
if len(slashSplit[-1]) < 1: | |
# If the trailing slash exists, just return the item before that, as the trailing slash contains 0 characters after it | |
if len(slashSplit[3]) == 0: | |
return '/' | |
else: | |
return slashSplit[-2] | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Print a line to the console in red text: | |
print(f'\033[31mThis is red text\033[0m') | |
#Print a line to the console in green text: | |
print(f'\033[32mThis is green text\033[0m') | |
#Print a line to the console in yellow text: | |
print(f'\033[33mThis is yellow text\033[0m') | |
#Print a line to the console in blue text: |