Skip to content

Instantly share code, notes, and snippets.

View jsmayo's full-sized avatar
👨‍💻

Jesse jsmayo

👨‍💻
View GitHub Profile
@jsmayo
jsmayo / snkeepalive.sh
Created January 25, 2020 05:37 — forked from assertivist/snkeepalive.sh
keeps a ServiceNow developer instance awake, at least until the nightly snooze-all
#!/bin/bash
# put your instance id here
instance="dev######"
# make sure your password doesn't have shell operators in it
credentials="admin:password"
while true; do
entropy=`rand`
outdata="{\"short_description\":\"Automated incident $entropy\"}"
@jsmayo
jsmayo / gist:6c1af46efae7c500ac2671b3837d8416
Created October 9, 2019 17:40 — forked from JT5D/gist:a2fdfefa80124a06f5a9
Google translate language codes
Eg. URL translating en page to es
http://translate.google.com/translate?hl=en&sl=en&tl=es&u=http://about.com
Define the web interface language to be English by adding
hl=en to the end of the URL and after the change the URL will look
like this:
http://www.google.com/search?hl=en
When you use more than one setting code in the URL, you need to use
@jsmayo
jsmayo / JournalRedactor.js
Created September 12, 2019 23:31 — forked from thisnameissoclever/JournalRedactor.js
Redact or delete a given journal entry in ServiceNow. Usage documentation: http://redactor.snc.guru/
/*
Script Include
Name: JournalRedactor
Client Callable: false
Accessible from: All scopes
Usage documentation: http://redactor.snc.guru/
*/
var JournalRedactor = Class.create();
JournalRedactor.prototype = {
@jsmayo
jsmayo / pandoc-build.js
Created November 26, 2018 16:41 — forked from jacebenson/pandoc-build.js
Output pandoc command
// just run node pandoc-build.js > output.txt
// that will write the contents of this there
// and then just copy paste that command and
// you should get a good epub.
// I always had to cd to the root of the posts
// directory to run the command.
var fs = require('fs');
var path = require('path');
var output = [
"pandoc -o _book.epub \\\n",
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
@jsmayo
jsmayo / automatically_link.br.js
Created November 26, 2018 16:40 — forked from jacebenson/automatically_link.br.js
Business rule to create links where other records are typed in
@jsmayo
jsmayo / push_comments_to_ritm_from_sc_task.br.js
Created November 26, 2018 16:39 — forked from jacebenson/push_comments_to_ritm_from_sc_task.br.js
Syncing Comments between Requested Item and Catalog Task
//Name: push comments to ritm
//Table: Catalog Task
//When: Before
//Insert: false
//Update: true
(function executeRule(current, previous /*null when async*/) {
try{
var sc_req_item = new GlideRecord('sc_req_item');
if(sc_req_item.get(current.request_item)){
sc_req_item.comments = current.comments;
@jsmayo
jsmayo / global.choiceUtil.si.js
Created November 26, 2018 16:39 — forked from jacebenson/global.choiceUtil.si.js
Show Hints for choice lists
//script include global.choiceUtil
//client callable true
var choiceUtil = Class.create();
choiceUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getHint: function() {
try {
var returnObj = {};
var hint = new GlideRecord('sys_choice');
hint.addQuery('name', this.getParameter('sysparm_table'));
hint.addQuery('field', this.getParameter('sysparm_field'));
@jsmayo
jsmayo / internal_catalog.do.xml
Created November 26, 2018 16:39 — forked from jacebenson/internal_catalog.do.xml
UI Page to redirect to new Service Portal
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
window.location.href = '/cms'
</script>
</j:jelly>