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 ship(code) { | |
const _ne = Object.entries(code) | |
.reduce((a, [k,v]) => ({ ...a, [k]:v }), {}); | |
const { defaults = {} } = code; | |
const [_den, _de] = Object.entries(defaults)?.[0]; | |
if (typeof module !== 'undefined' && module.exports) { | |
module.exports = _ne || {}; | |
} | |
else if (_den && _de) { globalThis[_den] = _de; } | |
} |
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 ship(code) { | |
const _ne = Object.entries(code) | |
.reduce((a, [k,v]) => ({ ...a, [k]:v }), {}); | |
const { defaults = {} } = code; | |
const [_den, _de] = Object.entries(defaults)?.[0]; | |
if (typeof module !== 'undefined' && module.exports) { | |
module.exports = _ne || {}; | |
} | |
else if (_den && _de) { globalThis[_den] = _de; } | |
} |
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() { | |
const HTML = new Proxy( | |
class HTML { | |
static create( | |
name, | |
content, | |
style = {}, | |
attributes = {}, | |
webComponentName = undefined, | |
useDocument = undefined, |
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
/** | |
* Creates a `CarrierString` by attaching additional properties to a string. | |
* This function allows for the creation of a string that carries extra data in a type-safe way. | |
* | |
* @param string The base string to which properties will be attached. | |
* @param key The key of the property to attach, or an object with multiple properties. | |
* @param value The value associated with the key, if `key` is not an object. | |
* @returns A new `CarrierString` with the attached properties. | |
* | |
* @example |
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
convertFonts() { | |
if [[ ${#} -lt 1 ]]; then | |
echo "Usage: convertFonts <startDir> <outDir> [rename]" | |
echo "where" | |
echo " outDir - if missing, this is the same as startDir" | |
echo "\n\x1b[3mIf rename is \x1b[1mtrue\x1b[22m, old file name is mv'ed to the new name" | |
echo "otherwise a copy is made and the original is untouched.\x1b[23m" | |
else | |
startDir="${1:-.}" | |
outDir="${startDir}" |
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
/** | |
* Applies Select Graphic Rendition (SGR) parameters to a given message for | |
* styling in terminal environments. This function allows for the dynamic | |
* styling of text output using ANSI escape codes. It supports a variety of | |
* modes such as color, brightness, and text decorations like bold or underline. | |
* | |
* @param {string} message The message to be styled. | |
* @param {...string} useModes A series of strings representing the desired | |
* styling modes. Modes can include colors (e.g., 'red', 'blue'), brightness | |
* ('bright'), foreground/background ('fg', 'bg'), and text decorations |
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
[ | |
AggregateError: function { | |
constructor, name, message, | |
}, | |
Array: function { | |
length, constructor, at, concat, copyWithin, fill, find, findIndex, | |
lastIndexOf, pop, push, reverse, shift, unshift, slice, sort, splice, | |
includes, indexOf, join, keys, entries, values, forEach, filter, flat, | |
flatMap, map, every, some, reduce, reduceRight, toLocaleString, toString, |
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
# Replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | |
RUN mkdir -p /usr/local/nvm | |
ENV NVM_DIR /usr/local/nvm | |
ENV NODE_VERSION 21.6.1 | |
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \ | |
&& . $NVM_DIR/nvm.sh \ | |
&& nvm install $NODE_VERSION \ |
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
-- Drop the existing procedure if it exists | |
DROP PROCEDURE IF EXISTS SANDBOX_PRODUCT_ENGINEERING.CONTENT_OPTIMIZATION.insert_update_url_entry; | |
-- Create the new stored procedure | |
CREATE OR REPLACE PROCEDURE SANDBOX_PRODUCT_ENGINEERING.CONTENT_OPTIMIZATION.insert_update_url_entry( | |
p_id FLOAT, | |
p_href TEXT, | |
p_name VARCHAR) | |
RETURNS STRING | |
LANGUAGE JAVASCRIPT |
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
-- Drop existing trigger and function if they exist | |
DROP TRIGGER IF EXISTS trigger_before_insert_update_url_entry ON url_entries; | |
DROP FUNCTION IF EXISTS before_insert_url_entry(); | |
-- Drop the existing table if it exists | |
DROP TABLE IF EXISTS url_entries; | |
-- Create the new table | |
CREATE TABLE url_entries ( | |
id SERIAL PRIMARY KEY, |