Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?><unload unload_date="2025-05-15 18:45:54">
<sys_remote_update_set action="INSERT_OR_UPDATE">
<application display_value="Global">global</application>
<application_name>Global</application_name>
<application_scope>global</application_scope>
<application_version/>
<collisions/>
<commit_date/>
<deleted/>
<description>parse [tag]value[/tag] values into name-value pairs</description>
@ChecksumFailed
ChecksumFailed / prompt.txt
Created April 30, 2025 14:15
Generate Class Documentation
Write documentation for the attached script. Use the following criteria:
Documentation Structure:
Class Overview: A general overview of the script's purpose and functionality.
Class Methods:
Method Description: A brief description of each method's functionality.
Parameters:
Name: The parameter's name.
Type: The data type of the parameter (e.g., String, Boolean, Object).
Required: Indicates if the parameter is mandatory or optional.
Description: A detailed explanation of the parameter's role.
/**
* Method to handle try/catch
* @param {Function} tryMethod - Method to try
* @param {Function} catchMethod - Method to call in case of error
* @param {Array} methodParams - Array of arguments to call with function.apply
* @private
* @returns Result of tryMethod or exception
*/
_tryCatch: function (tryMethod, catchMethod) {
var context = this;
/**
* Normalzies exception string for logging
* @param {Exception} e
* @returns {string} message
* @private
*/
{
_formatErrorMessage: function (e) {
try {
/*----------------------------------------------------*/
/* */
/* Have a bunch of apps that need to be updated? */
/* Run this and follow the directions in the output */
/* It will build a payload and use the CI/CD API to */
/* run a batch install of all of the needed updates. */
/* */
/*----------------------------------------------------*/
//Want Demo Data with the app?
/**
* @namespace cf_HTMLTableParser
* @description A module for parsing HTML tables into an array of objects.
*/
var cf_HTMLTableParser = (function () {
var logger = new GSLog('', "cf_HTMLTableParser");
/**
* Parses HTML tables into an array of objects.
Example Structure of an HTML document with two tables
/**
* Takes a nested object and flattens its to one level. Function recursively calls itself until finished.
* //https://stackoverflow.com/questions/34513964/how-to-convert-this-nested-object-into-a-flat-object
* @public
* @param {Object} currentNode - Current node in the nested object to process
* @param {object} flattenedObject - The new object containing the flattened values
* @param {object} flattendKey - The current flattened key name. Example: key.key1.key2
* @returns {Object}
* @example var testObj = {
"key1" : "test1",
@ChecksumFailed
ChecksumFailed / glideRecordHelper.js
Last active March 22, 2024 15:34
Just some random things
/**
* Creates a new GlideRecord Object from inputs, calls query(), then retuns the Object
* @private
* @param {object} options - Object containing table and any gliderecord methods to call
* @returns {GlideRecord}
* @example
* var options = {
* "table": "cmdbi_ci_computer",
* "methods": {
* "addEncodedQuery": "active=true",
@ChecksumFailed
ChecksumFailed / cf_getActiveUserSessions.js
Created October 31, 2023 13:06
ServiceNow: Get Active Sessions with username and node
/**
* Retrieves active user sessions and associated nodes for a list of user IDs.
*
* @param {string[]} userIDs - An array of user IDs for which to retrieve active sessions.
* @returns {Object[]|undefined} - An array of session and node information, or undefined if no active sessions are found.
*/
function cf_getActiveUserSessions(userIDs) {
/**
* Internal function to get active sessions for given user IDs.
@ChecksumFailed
ChecksumFailed / ReadMe.md
Created October 17, 2023 20:53
SerivceNow Widget Exploit Testing

Powershell script to to test simple lis