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
| package com.vinaybedre.vertx.future; | |
| import io.vertx.core.Future; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.concurrent.ConcurrentHashMap; | |
| import java.util.function.Supplier; |
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
| package com.vinaybedre.vertx.future; | |
| import io.vertx.core.Future; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.concurrent.ConcurrentHashMap; | |
| import java.util.function.Supplier; |
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 java.util.Comparator; | |
| import java.util.function.Function; | |
| import java.util.List; | |
| class TestUtil { | |
| public static <T, U> boolean assertSorted( | |
| List<T> list, Function<T, U> fieldExtractor, Comparator<U> comparator) { | |
| if (list.isEmpty()) { | |
| return 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
| type Review @key(fields: "id") { | |
| id: ID! | |
| body: String | |
| author: User @provides(fields: "username") | |
| product: Product | |
| } | |
| type User @key(fields: "id") @extends { | |
| id: ID! @external | |
| username: String @external |
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
| package com.vinaybedre.gqlfederation.product; | |
| import com.apollographql.federation.graphqljava.Federation; | |
| import com.apollographql.federation.graphqljava._Entity; | |
| import com.coxautodev.graphql.tools.SchemaParser; | |
| import graphql.schema.GraphQLSchema; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import java.util.List; |
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
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Jest All", | |
| "program": "${workspaceFolder}/node_modules/.bin/jest", | |
| "args": ["--runInBand"], | |
| "console": "integratedTerminal", | |
| "internalConsoleOptions": "neverOpen", | |
| "disableOptimisticBPs": true, | |
| "windows": { |
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
| { | |
| "name": "Current TS File", | |
| "type": "node", | |
| "request": "launch", | |
| "args": ["${relativeFile}"], | |
| "runtimeArgs": ["--nolazy", "-r", "ts-node/register"], | |
| "sourceMaps": true, | |
| "cwd": "${workspaceRoot}", | |
| "protocol": "inspector" | |
| } |
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
| Array.prototype.forEachCust = function (func) { | |
| for (let i = 0; i < this.length; i++) { | |
| console.log(`Custom forEach for Array`); | |
| func(this[i], //The current array element | |
| i, //The current array element's index | |
| this); //The current array | |
| } | |
| } | |
| let arr = [1, 2, 3]; |
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
| //ArrayFlatter, flatens array of any nested levels | |
| var arrayFlatter = function(){ | |
| /** | |
| * Method to flatten input array. | |
| * @param {string} input - Input array, containing deeply nested array | |
| */ | |
| this.flatArray = function(input){ | |
| return new Array(JSON.stringify(input).replace(/[\[\]]/g,"")); | |
| } | |