Skip to content

Instantly share code, notes, and snippets.

View MarketingPip's full-sized avatar
🚬
🌳

Jared Van Valkengoed MarketingPip

🚬
🌳
View GitHub Profile
/* Basic Loop in BASIC progamming language
* For more BASIC / BAS resources -
* [BASIC Programming/Beginning BASIC/Control Structures/FOR...NEXT - Wikibooks, open books for an open world]
* https://en.wikibooks.org/wiki/BASIC_Programming/Beginning_BASIC/Control_Structures/FOR...NEXT
* [WHAT IS BASIC?]
* https://en.wikipedia.org/wiki/BASIC
*/
Dim i as Integer = 10
FOR i = 1 TO 10
@MarketingPip
MarketingPip / Tongue_Twisters.json
Created March 29, 2023 19:06
JSON list of tongue twisters.
[ "Peter Piper picked a peck of pickled peppers<br>\nA peck of pickled peppers Peter Piper picked<br>\nIf Peter Piper picked a peck of pickled peppers<br>\nWhere’s the peck of pickled peppers Peter Piper picked?",
"Betty Botter bought some butter<br>\nBut she said the butter’s bitter<br>\nIf I put it in my batter, it will make my batter bitter<br>\nBut a bit of better butter will make my batter better<br>\nSo ‘twas better Betty Botter bought a bit of better butter",
"How much wood would a woodchuck chuck if a woodchuck could chuck wood?<br>\nHe would chuck, he would, as much as he could, and chuck as much wood<br>\nAs a woodchuck would if a woodchuck could chuck wood",
"She sells seashells by the seashore",
"How can a clam cram in a clean cream can?",
"I scream, you scream, we all scream for ice cream",
"I saw Susie sitting in a shoeshine shop",
"Susie works in a shoeshine shop. Where she shines she sits, and where she sits she shines",
"Fuzzy Wuzzy was a bear. Fuzzy Wuzzy had
@MarketingPip
MarketingPip / Common_English_Nouns.json
Created April 2, 2023 04:02
A JSON list of 2000 "most common" English nouns - published as of 2023.
[
"time",
"year",
"people",
"way",
"Man",
"Day",
"thing",
"child",
"Mr",
@MarketingPip
MarketingPip / Canada_Postal_Code_Regex.md
Last active June 25, 2023 07:56
Regular Expression for finding a Canada Postal Code in a string.

Regex for Canada Postal Codes

This regular expression will find Canada Postal Code in a string.

[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d

Canada uses ANA NAN format.

Regex for e-mail address

This regular expression will match any email address in a string.

[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
@MarketingPip
MarketingPip / extract_food_NLP.js
Created July 5, 2023 18:51
Using NLP.js to extract some entities
/// Published to help someone out with this task! If they are reading this - hope this helped you! :)
// - ps check out @ https://github.com/MarketingPipeline and feel free to star something! :D
import { containerBootstrap } from "https://cdn.skypack.dev/@nlpjs/core@4.26.1";
import { Nlp } from "https://cdn.skypack.dev/@nlpjs/nlp@4.26.1";
import { LangEn } from "https://cdn.skypack.dev/@nlpjs/lang-en-min@4.26.1";
(async () => {
const container = await containerBootstrap();
import stringSimilarity from "https://cdn.skypack.dev/string-similarity@4.0.4";
var extractValues = function(str, pattern, options) {
options = options || {};
var delimiters = options.delimiters || ["{", "}"];
var lowercase = options.lowercase;
var whitespace = options.whitespace;
var special_chars_regex = /[\\\^\$\*\+\.\?\(\)]/g;
var token_regex = new RegExp( delimiters[0] + "([^" + delimiters.join("") + "\t\r\n]+)" + delimiters[1], "g");
@MarketingPip
MarketingPip / ConvertToOrdinal.js
Created August 3, 2023 07:41
A JavaScript function for converting number to ordinal.
function getOrdinal(number) {
if (typeof number !== 'number' || isNaN(number)) {
throw new Error('Input must be a valid number');
}
const suffixes = ['th', 'st', 'nd', 'rd'];
const remainder = number % 100;
const suffix = suffixes[(remainder - 20) % 10] || suffixes[remainder] || suffixes[0];
return number + suffix;
@MarketingPip
MarketingPip / ConvertYearsToText.js
Last active August 7, 2023 04:52
A basic function to convert years into text.
function numberToWords(number) {
const units = [
'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine',
'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'
];
const tens = [
'', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'
];
@MarketingPip
MarketingPip / Regex_For_Human_Time.md
Last active August 10, 2023 04:05
A regular expression for matching human readable time. Such as 5pm, 5.30 pm, 12 noon.

Regex for Human Time

This regular expression is for finding common time format in string. Example 5:18pm

(1[0-2]|0?[1-9]|(1[0-2]|0?[1-9]):([0-5][0-9])|(1[0-2]|0?[1-9]).([0-5][0-9]))\s?([AP]M|[AP].M|o'clock|oclock|noon|afternoon|in the morning|in the evening|this morning|this evening|later this evening|tonight|at night|at noon|midnight|[ap]m|[ap].m)

Tests

at 5:12pm oclock tommo