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
| 'use strict'; | |
| var input = 'this is a test string'; | |
| input = 'aaaabbbcccdddcdbaaa'; | |
| var match = 'tist'; //accb | |
| match = 'abc'; | |
| input = 'abcdefadfafaefd'; | |
| match = 'ef'; | |
| var matches = []; |
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
| // Given an input string, and an alphabet, find the shortest substring in the input containing every letter in the alphabet at least once | |
| // “aaccbc”, {‘a’, ‘b’, ‘c’} => “accb" | |
| // "aaaabbbcccdddcdba", [ 'a', 'b', 'c' ] => cdba | |
| for (var i = 0; i < input.length; i++) { | |
| for (var j = i; j < input.length; j++) { | |
| var s = input.substring(i,j); |
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
| app.use(function(req, res,next){ | |
| var caller = req.connection.remoteAddress; //Will give you the request IP Address | |
| next(); | |
| }); | |
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
| 'use strict'; | |
| /************************************************************************************************** | |
| * This sample demonstrates a few more advanced features of Swagger-Express-Middleware, | |
| * such as setting a few options, initializing the mock data store, and adding custom middleware logic. | |
| **************************************************************************************************/ | |
| // Set the DEBUG environment variable to enable debug output of Swagger Middleware AND Swagger Parser | |
| process.env.DEBUG = 'swagger:*'; | |
| var util = require('util'), |
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
| /** | |
| * @param {number[]} nums | |
| * @return {number} | |
| */ | |
| var maxSubArray = function (nums) { | |
| var start = 0; | |
| var next = start + 1; | |
| var sum1 = 0; | |
| var sum2 = 0; | |
| var max; |
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
| /** Runnable w/a Private Variable **/ | |
| package com.api.specs; | |
| /** | |
| * Hello world! | |
| * | |
| */ | |
| public class App { | |
| public static void main(String[] args) { |
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
| mvn archetype:generate -DgroupId=com.rameshrm -DartifactId=service-client -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false |
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
| 'use strict'; | |
| var util = require('util'); | |
| var async = require('async'); | |
| function FeatureStrategy(values) { | |
| this._values = values; | |
| this._strategyId; | |
| } | |
| FeatureStrategy.prototype.resolve = function (context) { |
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
| created | |
| deleted | |
| forced | |
| base_ref | |
| compare | |
| ****************************** | |
| commits.0 | |
| ****************************** | |
| commits.0.distinct |
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 fs = require('fs'); | |
| var Canvas = require('canvas') | |
| , Image = Canvas.Image | |
| , canvas = new Canvas(400, 600) | |
| , ctx = canvas.getContext('2d'); | |
| var te = ctx.measureText('Awesome!'); | |
| ctx.strokeStyle = 'rgba(0,0,0,0.5)'; | |
| ctx.beginPath(); |