Skip to content

Instantly share code, notes, and snippets.

View nancystodd's full-sized avatar

Nancy S Todd nancystodd

View GitHub Profile
@nancystodd
nancystodd / gist:e32d19fac97a9931f6cd6628c0d27210
Created August 19, 2024 18:48 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nancystodd
nancystodd / 01.bash_shortcuts_v2.md
Created August 19, 2024 18:39 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line

ServiceNow - Jelly scripting cheatsheet

UI Page consists of jelly, client script and processing script. UI Macro has the jelly script only (but client script can be injected in jelly script) Usages:

  • Open as a page using URI https://<instance_name>.service-now/<ui_page_name>.do
  • Open as a modal using client script (UI action, client script, etc) (see snippet 1)
// Snippet 1
var gm = new GlideModal('UI_dialog_name');
gm.setTitle('Show title');

GlideRecord & GlideAggregate Cheat Sheet ❗

GlideRecord(String tableName) ❗

var gr = new GlideRecord('incident'); // use the incident table
gr.query(); // fetch data from the database
while (gr.next()) { // advance
    gs.info(gr.short_description);
}
@nancystodd
nancystodd / JSUtil2.js
Created December 20, 2019 18:21 — forked from abhididdigi/JSUtil2.js
This is the entire JSUtil2 script. Creating a gist, to show it on Service Now diary.com
/*
* JSUtil already has some utility functions, Some more utility functions.
* Written by [email protected]
* Re-written for Service Now from underscore.js: http://underscorejs.org/
*
*/
var JSUtil2 = Class.create();

ServiceNow UI Developer cheat sheet


Utility URLs

URL Purpose
/stats.do Quick stats
/threads.do View active threads
@nancystodd
nancystodd / debugging_cheatsheet.md
Created October 25, 2019 23:59 — forked from iamwill/debugging_cheatsheet.md
Debugging on the Glide Platform

Debugging tips and tricks

Platform Troubleshooting

Console output too chatty?
Set com.glide.util.Log.developer_filter = true to cut down on non-interactive console log entries such as scheduled workers. (Don't forget to remove it when you're done!)

Utility urls

Note: Fast! These don't need a database.

@nancystodd
nancystodd / servicenow-scripting.md
Created October 24, 2019 00:40 — forked from animyeboah/servicenow-scripting.md
ServiceNow Developer Best Practices

GlideRecord

  • Use getUniqueValue to get sys_id.
  • Use newRecord instead of instantiating to get a new record with default values.
  • Dot-walking on GlideRecord returns GlideElement, use getRefRecord to get GlideRecord.

GlideForm

  • Use getBooleanValue for boolean fields.
@nancystodd
nancystodd / sample_restmessagev2.js
Created October 24, 2019 00:39 — forked from bryanbarnard/sample_restmessagev2.js
Sample RESTMessageV2 Parse JSON Response
// NOTE: this sample was run in a ServiceNow instance running release version Fuji Patch 4
(function sampleRequest() {
try {
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('get');
request.setEndpoint('https://rawgit.com/anonymous/f1c4664cafd6caf855fd/raw/f7ca3b022045e2c9f49dd2b453dea0cecc09888c/sample_json.json');
var response = request.execute();
var httpResponseStatus = response.getStatusCode();
@nancystodd
nancystodd / servicenow_restmessagev2_response_as_attachment.js
Created October 24, 2019 00:33 — forked from jnerius/servicenow_restmessagev2_response_as_attachment.js
Saving a RESTMessageV2 response as an attachment and getting the attachment's sys_id #ServiceNowSnippet
// This is where we'll save the attachment
var tablename = 'incident';
var recordSysId = '8d6353eac0a8016400d8a125ca14fc1f';
var filename = 'snlogo.png';
// Let's download the ServiceNow Logo
var logoUrl = 'https://instance.service-now.com/images/logos/logo_service-now.png';
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('get');
request.setEndpoint(logoUrl);