This file contains hidden or 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
| /** | |
| * Function that tests NFTs for spamminess using GPT-4o via the OpenAI API. | |
| * | |
| * @param address - The contract address of any NFT collection | |
| * @param network - The network the NFT is on (e.g. "ethereum") — refer to SimpleHash Docs for supported networks | |
| * @returns - A boolean indicating whether the NFT is spammy or not | |
| * | |
| * @example getNftSpamStatus({ address: "0x03c4738Ee98aE44591e1A4A4F3CaB6641d95DD9a", network: "base" }); -> false | |
| * @example getNftSpamStatus({ address: "0xDEB4f256312fa000B8564E0154e2d21b777e8f20", network: "base" }); -> false |
This file contains hidden or 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
| // iTunes API TypeScript Module | |
| type MediaType = | |
| | "movie" | |
| | "podcast" | |
| | "music" | |
| | "musicVideo" | |
| | "audiobook" | |
| | "shortFilm" | |
| | "tvShow" |
This file contains hidden or 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
| import relativeTime from "dayjs/plugin/relativeTime"; | |
| import dayjs from "dayjs"; | |
| dayjs.extend(relativeTime); | |
| function abbreviateDate(ms: number | string) { | |
| const t = dayjs(ms); | |
| const minutesAgo = dayjs().diff(t, "minute"); | |
| const hoursAgo = dayjs().diff(t, "hour"); |
This file contains hidden or 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
| function abbreviateNumber(value: number) { | |
| let suffix = ""; | |
| let divisor = 1; | |
| // Determine the suffix and divisor based on the value | |
| if (value >= 1e9) { | |
| suffix = "b"; | |
| divisor = 1e9; | |
| } else if (value >= 1e6) { | |
| suffix = "m"; |
This file contains hidden or 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
| // place in main styles file or import | |
| // examples: | |
| // - ".row-fs-c" is a row with flex-start on main axis and center on secondary axis | |
| // - ".col-sb-sb" is a column with space-between on main axis and secondary axis | |
| // - ".row-sa-fe" is a row with space-around on main axis and flex-end on secondary axis | |
| // - ".col": is a column with flex-start on main axis and secondary axis | |
| @mixin flex-layout-generator() { | |
| $directions: ( |
This file contains hidden or 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
| /** | |
| * Returns a relative time string for UI like in the Warpcast client. | |
| * Works for both past and future dates. | |
| * @param {number|string} ms - timestamp in milliseconds | |
| * @returns {string} - relative time string | |
| */ | |
| export function abbreviateTimeDiff(ms: number | string) { | |
| const t = new Date(ms).getTime(); | |
| const now = new Date().getTime(); |