This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatCurrency(amount) | |
{ | |
//truncate the amount to 0 decimals | |
//for every digit that is followed by 3 digits and a word boundary | |
//add a comma | |
amount = amount.toFixed(0).replace(/(\d)(?=(\d{3})+\b)/g, "$1,"); | |
return amount; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
function postRequest(post_data,responseObject) | |
{ | |
var url = 'http://www.example.com'; | |
var proxy_opt = 'http://domain:port'; | |
var post_options = { | |
uri:url, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//testing php curl | |
$authURL = 'https://someapi.com/rest/Authentication'; | |
$userName = 'userName'; | |
$apiKey = 'passwords'; | |
$proxyHost = 'host'; | |
$proxyPort = 1111; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src=""></script> | |
<link rel="stylesheet" href=""> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import the selenium web driver | |
var webdriver = require('selenium-webdriver'); | |
var chromeCapabilities = webdriver.Capabilities.chrome(); | |
//setting chrome options to start the browser fully maximized | |
var chromeOptions = { | |
'args': ['--test-type', '--start-maximized'] | |
}; | |
chromeCapabilities.set('chromeOptions', chromeOptions); | |
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select to_timestamp(sysdate) + (dbms_random.value(0,86400)/86400)) | |
from dual; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> | |
<display-name>RichFacesExperiment</display-name> | |
<welcome-file-list> | |
<welcome-file>index.html</welcome-file> | |
<welcome-file>index.htm</welcome-file> | |
<welcome-file>index.jsp</welcome-file> | |
<welcome-file>default.html</welcome-file> | |
<welcome-file>default.htm</welcome-file> | |
<welcome-file>default.jsp</welcome-file> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonSlurper; | |
import com.eviware.soapui.support.types.StringToStringMap; | |
//get the response from the test step that makes the call to get the authentication token | |
def authResponse = testRunner.testCase.getTestStepByName("GetToken").getPropertyValue("response"); | |
//parse the json response | |
def authResponseJSON = new JsonSlurper().parseText(authResponse); | |
//access the access_token property in the respose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import library to parse JSON | |
import groovy.json.JsonSlurper; | |
//get the JSON response from the test step that makes the call to some test step to get a JSON repsonse | |
def response = testRunner.testCase.getTestStepByName("TestStepName").getPropertyValue("response"); | |
//parse the json response | |
def responseJSON = new JsonSlurper().parseText(response); | |
//access the propertyname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$i++; | |
//add remote server hostname or ip | |
$cfg['Servers'][$i]['host'] = 'hostname or ip'; | |
$cfg['Servers'][$i]['port'] = ''; | |
$cfg['Servers'][$i]['socket'] = ''; | |
$cfg['Servers'][$i]['connect_type'] = 'tcp'; | |
$cfg['Servers'][$i]['extension'] = 'mysql'; | |
$cfg['Servers'][$i]['compress'] = FALSE; |
OlderNewer