Skip to content

Instantly share code, notes, and snippets.

View jnerius's full-sized avatar

Josh Nerius jnerius

View GitHub Profile
@jnerius
jnerius / OAuthGitHubHandler.js
Last active November 18, 2022 19:16
ServiceNow OAuth Handler Script Include for processing OAuth Responses from GitHub
var OAuthGitHubHandler = Class.create();
OAuthGitHubHandler.prototype = Object.extendsObject(OAuthUtil, {
// Override postprocessAccessToken method. GitHub returns a urlencoded
// body, so we need to break this apart and extract the values.
postprocessAccessToken: function(accessTokenResponse) {
var contentType = accessTokenResponse.getContentType();
var contentBody = accessTokenResponse.getBody();
var paramMap = accessTokenResponse.getparameters();
var params = contentBody.split('&');
var parts;
@jnerius
jnerius / OAuthBitlyHandler.js
Last active February 28, 2021 19:21
ServiceNow OAuth Handler Script Include for processing Bit.ly OAuth Tokens
var OAuthBitlyHandler = Class.create();
OAuthBitlyHandler.prototype = Object.extendsObject(OAuthUtil, {
initialize: function() {
},
interceptRequestParameters : function(requestParamMap) {
// Add/Modify request parameters if needed
this.preprocessAccessToken(requestParamMap);
},
@jnerius
jnerius / 0_reuse_code.js
Created October 18, 2016 16:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jnerius
jnerius / servicenow_restmessagev2_response_as_attachment.js
Last active June 28, 2023 03:59
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);
//Define some vars
var doc = conversation.document;
var table = doc.getTableName();
var sysId = doc.getUniqueValue();
var display = doc.getDisplayValue();
var docLink = "<" + gs.getProperty('glide.servlet.uri') + "/" + doc.getLink() + "|" + display + ">";
//Create the messages for Connect and Slack
var connectMessage = "(via " + gs.getUserDisplayName() + ") " + text;
var slackMessage = "(via " + gs.getUserDisplayName() + ") " + docLink + ": " + text;
# Failed to process the preconfiguration file
d-i preseed/load_error error
# Do you want to return to the partitioning menu?
partman-basicfilesystems partman-basicfilesystems/no_swap boolean true
# Error while creating a new logical volume
partman-lvm partman-lvm/lvcreate_exists error
# Wait another 30 seconds for hwclock to set the clock?
clock-setup clock-setup/hwclock-wait boolean false
# No root file system
partman-target partman-target/no_root error
# Keymap to use:
# Choices: American English, Albanian, Arabic, Asturian, Bangladesh, Belarusian, Bengali, Belgian, Bosnian, Brazilian, British English, Bulgarian, Bulgarian (phonetic layout), Canadian French, Canadian Multilingual, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Dvorak, Dzongkha, Esperanto, Estonian, Ethiopian, Finnish, French, Georgian, German, Greek, Gujarati, Gurmukhi, Hebrew, Hindi, Hungarian, Icelandic, Irish, Italian, Japanese, Kannada, Kazakh, Khmer, Kirghiz, Korean, Kurdish (F layout), Kurdish (Q layout), Lao, Latin American, Latvian, Lithuanian, Macedonian, Malayalam, Nepali, Northern Sami, Norwegian, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Serbian (Cyrillic), Sindhi, Sinhala, Slovak, Slovenian, Spanish, Swedish, Swiss French, Swiss German, Tamil, Telugu, Thai, Turkish (F layout), Turkish (Q layout), Ukrainian, Uyghur, Vietnamese
d-i keyboard-configuration/xkb-keymap select us
keyboard-configuration keyboard-configuration/xkb-keymap select us
# Remove obsolete /us