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
public static boolean sendNewRecordsEmail(String[] toAddresses, String sobjectName, DateTime createdAfter) { | |
String strCreatedAfter = createdAfter.formatGMT('yyyy-MM-dd\'T\'HH:mm:ss\'Z\''); | |
// Get the count of records after the createdAfter date/time. | |
String restSOQL = String.join( | |
new String[]{ | |
'SELECT count(Id) record_count', | |
'FROM ' + sobjectName, | |
'WHERE CreatedDate > ' + strCreatedAfter | |
}, |
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
/** | |
* Custom console object to allow for objects to be printed correctly in the | |
* console by leveraging iframes. | |
* @type {Console} | |
*/ | |
const CONSOLE = ((realConsole) => { | |
let iframe; | |
try { | |
iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; |
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
/** | |
* Can load multiple scripts (javascript and css) and finishes once the | |
* `checker` returns a promised value that is not falsy. | |
* @param {string[]} urls | |
* Ordinarily a URL is determined to be for CSS or JS by the extension of the | |
* pathname but if it doesn't end in .js or .css this will not be possible and | |
* it will default to JS. If you want to force a URL to be recognized as a JS | |
* file you should prefix the URL with `"js:"` and if you want it to be | |
* recognized as a CSS file you should prefix it with `"css:"`. | |
* @param {null|undefined|{ |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset='UTF-8'> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Clickable Dragon Balls</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.2.37/vue.global.prod.min.js"></script> | |
<script> | |
addEventListener('DOMContentLoaded', () => { | |
Vue.createApp({ |
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
/** | |
* Extracts substrings from the given `string` by using `regexp`. | |
* @type {{ | |
* (regexp: RegExp, string: string) => RegExpExecArray; | |
* <T>(regexp: RegExp, string: string, handler: (matches: RegExpExecArray) => T) => T; | |
* }} | |
*/ | |
const extract = (regexp, string, handler) => { | |
const matches = regexp.exec(string) ?? []; | |
return handler ? handler(matches) : matches; |
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
/** | |
* Partitions a string by using the given delimiter. | |
* @param {string} string | |
* @param {string|RegExp} delimiter | |
* @returns {(string | (string[] & {input: string, index: number, groups?: Record<string,string>}))[]} | |
* All items of an even index in the zero-indexed array will be strings while | |
* all items of an odd index will be `RegExpMatchArray` objects. | |
*/ | |
function partition(string, delimiter) { | |
const parts = []; |
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
function formatIntlDate(date, format, options) { | |
return format.replace( | |
/<<|>>|<(\w)(?:\|([^>]+))?>/g, | |
(fullMatch, type, option) => { | |
if (!type) return fullMatch.charAt(0); | |
if (/^[YMDHhmsf]$/.test(type ?? '')) option ??= 'numeric'; | |
const subOptions = {timeZone: options?.timeZone ?? undefined}; | |
let partType; |
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
/** | |
* Function that waits for the DOM to be ready to be manipulated. | |
* @returns {Promise<undefined>} | |
* A promise that will be finished after the DOM is ready to be manipulated. | |
*/ | |
function waitForReadyDOM() { | |
return new Promise(async resolve => { | |
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', () => resolve()); | |
else resolve(); | |
}); |
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
/** | |
* Determines if `input` is a primitive value or not. | |
* @param {any} input | |
* The input value to test. | |
* @returns {boolean} | |
* Returns `true if `input` is a primitive, otherwise `false` is returned. | |
*/ | |
function isPrimitive(input) { | |
if (input == null) { | |
// This is here to correctly handle document.all. |
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
class Searcher { | |
/** @type {string} */ | |
#terms; | |
/** @type {boolean} */ | |
#matchWordStart; | |
/** @type {boolean} */ | |
#matchWordEnd; | |
/** @type {RegExp} */ | |
#rgxFullNeg; | |
/** @type {RegExp} */ |