Skip to content

Instantly share code, notes, and snippets.

View rafzk's full-sized avatar

Rafael Cardoso rafzk

View GitHub Profile
@rafzk
rafzk / OBWS_2.md
Created November 22, 2022 23:59 — forked from seresistvanandras/OBWS_2.md
Hacking smart contracts for fun and profit

Hacking smart contracts for fun and profit

Description of the game

The goal of the game to break as many contracts as possible! Note: one of these contracts is a HONEYPOT! BE CAREFUL!!

Claim your Ropsten test ether here!

The contracts you need to break and their addresses:

@rafzk
rafzk / JSONtoGlide.js
Created March 4, 2020 12:49 — forked from jmbauguess/JSONtoGlide.js
Converts a GlideRecord object into JSON, or converts JSON into a GlideRecord. See http://sensibleservicenow.com/?p=49
/**
* @description Converts between JSON Objects and GlideRecords
* @namespace
* @type {Class}
*/
var JSONtoGlide = Class.create();
JSONtoGlide.prototype = {
/**
* @description Converts an object into a new GlideRecord
* @param {Object} json A json object
@rafzk
rafzk / Creating productionProcess using GoJS.md
Last active February 23, 2020 22:06
[Creating productionProcess using GoJS] In this snippet you will create a custom process using a custom page and populating data using GoJS native library. #serviceportal #gojs

Creating productionProcess using gojs

Introduction

In this snippet you will create a custom process using a custom page and populating data using GoJS native library

Step 1: Create a new Widget

Go to Service Portal > Widget > Click New

  • Name: Custom productionProcess
  • Id: custom-gojs-productionProcess
  • Click on submit
@rafzk
rafzk / Publishing all form fields on Service Portal.md
Last active August 11, 2023 14:52
[Publishing all form fields on Service Portal]

Publishing all form fields on Service Portal

Introduction

In this snippet you will create a custom form widget with a custom page and populated using custom spModel. For more information, take a look on the link https://community.servicenow.com/community?id=community_article&sys_id=955c66a1dbd0dbc01dcaf3231f9619e4

Step 1: Create a new Widget

Go to Service Portal > Widget > Click New

  • Name: Custom Form
  • Id: custom-highcharts-spiderweb
  • Click on submit
@rafzk
rafzk / Creating SpiderWeb Report using Highcharts.md
Last active August 23, 2019 07:49
[Creating Report using Highcharts] In this snippet you will create a custom report with a custom page and populated using native library. #serviceportal #highcharts

Creating SpiderWeb Report using Highcharts

Introduction

In this snippet you will create a custom SpiderWeb report on a custom page using the native library. Plus, there is a dropdown that automatically updates the spider depending on the data you select.

Step 1: Create a new Widget

Go to Service Portal > Widget > Click New

  • Name: Custom SpiderWeb
  • Id: custom-highcharts-spiderweb
  • Click on submit
@rafzk
rafzk / Creating Process Flow.md
Last active August 22, 2019 13:17
[Creating Process Flow] In this snippet you will create a custom process flow with a custom page and populated with standard widgets. #serviceportal #processflow

Creating Process flow in service portal

Introduction

In this snippet you will create a custom process flow with a custom page and populated with standard widgets.

Step 1: Create a new Widget

Go to Service Portal > Widget > Click New

  • Name: Process Flow
  • Id: process-flow
  • Click on submit
@rafzk
rafzk / updateScoring.js
Last active August 14, 2019 11:27
[updateScoring] The following snippet can be used to update scoring #scoring #risk
// Calculate scores
updateScoring("ITISO-032","3","3","3","4","3","1");
// Functions
function translateRiskCriteria(fieldName, fieldValue) {
var query = "type="+fieldName +"^display_value=" + fieldValue;
var gr = new GlideRecord('sn_risk_criteria');
var result = "";
gr.addEncodedQuery(query);
@rafzk
rafzk / translateRiskCriteria.js
Last active August 14, 2019 11:25
[translateRiskCriteria] The following snippet can be used to translate a risk criteria number into value and can be easily applied to transform map, fix scripts, etc #risk #scoring
// Usage: translateRiskCriteria('likelihood',3);
function translateRiskCriteria(fieldName, fieldValue) {
var query = "type="+fieldName +"^display_value=" + fieldValue;
var gr = new GlideRecord('sn_risk_criteria');
var result = "";
gr.addEncodedQuery(query);
gr.query();
if (gr.next()) {