Skip to content

Instantly share code, notes, and snippets.

View DinoChiesa's full-sized avatar

Dino Chiesa DinoChiesa

View GitHub Profile
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
version="1.0">
<xsl:output method="xml"
omit-xml-declaration="yes"
indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
# Create-App-With-Imported-App-Credentials.ps1
function Create-App-With-Imported-App-Credentials {
<#
.SYNOPSIS
Imports a key+secret (a credential) into Apigee Edge.
.DESCRIPTION
Imports a key+secret (a credential) into Apigee Edge. This will be stored in
a newly-created developer app, which will be associated to an existing developer.
@DinoChiesa
DinoChiesa / JS-Log-To-Splunk.xml
Created May 1, 2017 22:55
JS policy config for fire-and-forget logging to Splunk
<Javascript name='JS-Log-To-Splunk' timeLimit='2200'>
<!--
timeLimit = 2200 to allow for waiting for Splunk to respond.
This is necessary only during diagnostic efforts.
See the KVM entry "splunk_await_response". In normal
cases, the JS logic does not wait for a response.
-->
<Properties>
<Property name='authz_header'>Splunk {splunk_hec_token}</Property>
<!--
@DinoChiesa
DinoChiesa / log-to-Splunk.js
Created May 1, 2017 22:53
JS Callout code to log to Splunk using a HEC token
// log-To-Splunk.js
// ------------------------------------------------------------------
//
// Fill a message template, then POST to splunk without waiting for a response.
//
// created: Wed Feb 15 16:28:55 2017
// last saved: <2017-March-08 18:28:03>
var variableNameRe = "[^ \t\n\"',/\\\\]+?"; // non-greedy capture
var varPrefixRe = '{';
@DinoChiesa
DinoChiesa / dateFormat.js
Created March 20, 2017 20:57
A simple dateFormat function for JavaScript to simulate PHP's date function
// dateFormat.js
// ------------------------------------------------------------------
//
// Provide a dateFormat function for JavaScript that simulates or
// replicates PHP's date function.
//
// example usage:
// var d = new Date();
// var s1 = dateFormat(d,"Y-M-d\\TH:i:s.u"); // 2017-Mar-20T12:38:29.972
// var s2 = dateFormat(d,"Y-M-d\\TH:i:s"); // 2017-Mar-20T12:38:29
(load-file "~/elisp/emacs.el")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(git-commit-summary-max-length 80)
'(ls-lisp-format-time-list (quote ("%Y-%m-%d %H:%M" "%Y-%m-%d %H:%M")))
'(ls-lisp-use-localized-time-format t)
'(safe-local-variable-values (quote ((js-indent-level . 2))))
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty-updates restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse #Added by software-properties
deb-src http://security.ubuntu.com/ubuntu trusty-security restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty-proposed restricted main universe multiverse #Added by software-properties
// generateUuid.js
// ------------------------------------------------------------------
//
// created: Wed Dec 14 13:44:38 2016
// last saved: <2016-December-14 13:44:44>
function generateUUID(){
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
curl -i -u VyFNU1xB6oDjmRaAQEmpNZzGNA9X3IAM:HDs4t5JSSSzsBAhA \
https://nordstrom-eval1-test.apigee.net/v2/authorizationservice/shopperauth/token -X POST \
-d 'grant_type=password&[email protected]&password=Passw0rd'
curl -i https://nordstrom-eval1-test.apigee.net/shopper-service/validate \
-H Content-type:application/json \
-d '{"username":"[email protected]", "password": "Passw0rd"}'
<OAuthV2 name='OAuthV2-GenerateAccessToken-PG'>
<!-- created at 2016-03-26T02:43:06+0000 -->
<Operation>GenerateAccessToken</Operation>
<!--
ExpiresIn, in milliseconds. The ref is optional. The explicitly specified
value is the default, when the variable reference cannot be resolved.
1800000 = 30 minutes
2400000 = 40 minutes
3600000 = 60 minutes
-->