Skip to content

Instantly share code, notes, and snippets.

View nidri's full-sized avatar

Krishna Santosh Nidri nidri

View GitHub Profile
@nidri
nidri / Pega-SpeechRecognition.js
Last active August 26, 2022 19:20
Pega-SpeechRecognition
// Functions in this js file and element references are done using Pega 8.6
// Modify the references according to the Pega version.
function showStatus() {
const speechStatusDiv = document.querySelector('[data-tour-id="speechStatus"]');
const speechStatus = speechStatusDiv.querySelector('.field-item');
speechStatus.innerHTML = "Listening..";
}
function hideStatus() {
@nidri
nidri / setCookie.java
Created February 8, 2022 15:00
Set custom cookie in Pega PRPC in Java step
// Cookie has to be set on 'set_cookie' property on pyHttpResponseHeaders on pxRequestor page
try {
tools.getRequestor().getRequestorPage().getPage("pyHTTPResponseHeaders").putString("set_cookie", "PegaCustomCookie= someCookieValue; Path=/prweb; Secure; HttpOnly;");
}
catch(Exception e) {
oLog.error("Exception while setting custom cookie" + e.getMessage());
e.printStackTrace();
}
@nidri
nidri / deferredOps.java
Created January 15, 2022 00:54
Pega - Get instances from DeferredOps into Pagelist - SAVE operations
// Create a Code-Pega-List page
tools.createPage("Code-Pega-List", "Instances");
// Connect to Pega DB and get deferred operations
PegaDatabase db = (PegaDatabase) tools.getDatabase();
java.util.Iterator deferredOps = db.getDeferredOps().iterator();
while (deferredOps.hasNext()) {
ClipboardPage instancePage = null;
DeferredOperation op = (DeferredOperation) deferredOps.next();
// Getting instances only for SAVE operations
@nidri
nidri / index-starratings.html
Last active June 5, 2020 14:13
Star Ratings
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Star Rating</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">