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
| // weightedRandomSelector.js | |
| // | |
| // simple weighted random selector. | |
| // | |
| // Copyright © 2013, 2014 Dino Chiesa and Apigee Corp | |
| // All rights reserved. | |
| // | |
| // created: Fri, 26 Jul 2013 11:14 | |
| // last saved: <2019-June-24 06:13:20> | |
| // |
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
| // updateSheets.js | |
| // ------------------------------------------------------------------ | |
| // | |
| // created: Tue Jan 14 05:22:42 2020 | |
| // last saved: <2020-January-14 06:34:31> | |
| const fs = require('fs'), | |
| path = require('path'), | |
| util = require('util'), | |
| {google} = require('googleapis'), |
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
| // base64.js | |
| // ------------------------------------------------------------------ | |
| // | |
| // Bas64 encoder and decoder | |
| // | |
| // created: Sat Feb 20 12:30:51 2016 | |
| // last saved: <2016-May-19 11:48:04> | |
| (function (){ |
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
| const app = require('express')(), | |
| bodyParser = require('body-parser'), | |
| yes = require('yes-https'); // HSTS => https always | |
| var gStatus = { | |
| version : '20180619-1845' | |
| }; | |
| // HSTS on only if process.env.NODE_ENV == 'production' | |
| app.use(yes()); |
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
| const app = require('express')(), | |
| bodyParser = require('body-parser'); | |
| var gStatus = { | |
| version : '20180619-1845' | |
| }; | |
| app.use(bodyParser.json()); | |
| app.use(bodyParser.urlencoded({ extended: true })); |
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
| // extractJsonToContextVars.js | |
| // ------------------------------------------------------------------ | |
| // | |
| // For a JSON payload, set context vars for all fields. | |
| // | |
| // Use a policy config like this: | |
| // | |
| // <Javascript name='JS-RipJiraResponse' timeLimit='200' > | |
| // <Properties> | |
| // <Property name='prefix'>json</Property> |
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
| String canonicalPath = "/users/foo/bar/something.xml"; | |
| String xml = new String(Files.readAllBytes(Paths.get(canonicalPath)), StandardCharsets.UTF_8); | |
| XMLStreamReader sr = XMLInputFactory.newFactory().createXMLStreamReader(new FileInputStream(cpath)); | |
| XmlMapper mapper = new XmlMapper(); | |
| Map m = (Map) mapper.readValue(sr, Object.class); |
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
| $ diff URI.js URI-orig.js | |
| 15,16c15,25 | |
| < // Node | |
| < module.exports = factory(null, null, null, root); | |
| --- | |
| > // https://github.com/umdjs/umd/blob/master/returnExports.js | |
| > if (typeof module === 'object' && module.exports) { | |
| > // Node | |
| > module.exports = factory(require('./punycode'), require('./IPv6'), require('./SecondLevelDomains')); | |
| > } else if (typeof define === 'function' && define.amd) { |
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
| $ ./ProduceApiProxyZip.sh ~/dev/community-examples/crypto-test | |
| Creating the zip at apiproxy-crypto-test-20170831-164831.zip | |
| zipping the node modules... | |
| Archive: apiproxy-crypto-test-20170831-164831.zip | |
| Length Date Time Name | |
| --------- ---------- ----- ---- | |
| 0 04-26-2017 11:11 apiproxy/ | |
| 437 04-26-2017 11:11 apiproxy/crypto-test.xml | |
| 0 04-26-2017 11:24 apiproxy/policies/ |