Skip to content

Instantly share code, notes, and snippets.

@RameshRM
RameshRM / fb-initial
Last active September 27, 2016 18:50
// 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);
app.use(function(req, res,next){
var caller = req.connection.remoteAddress; //Will give you the request IP Address
next();
});
'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'),
/**
* @param {number[]} nums
* @return {number}
*/
var maxSubArray = function (nums) {
var start = 0;
var next = start + 1;
var sum1 = 0;
var sum2 = 0;
var max;
/** Runnable w/a Private Variable **/
package com.api.specs;
/**
* Hello world!
*
*/
public class App {
public static void main(String[] args) {
mvn archetype:generate -DgroupId=com.rameshrm -DartifactId=service-client -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
'use strict';
var util = require('util');
var async = require('async');
function FeatureStrategy(values) {
this._values = values;
this._strategyId;
}
FeatureStrategy.prototype.resolve = function (context) {
created
deleted
forced
base_ref
compare
******************************
commits.0
******************************
commits.0.distinct
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();
var Canvas = require('canvas')
, Image = Canvas.Image
, canvas = new Canvas(200, 200)
, ctx = canvas.getContext('2d');
ctx.font = '30px Impact';
ctx.rotate(.1);
ctx.fillText("Awesome!", 50, 100);
var te = ctx.measureText('Awesome!');