Skip to content

Instantly share code, notes, and snippets.

import { GraphQLScalarType } from "graphql";
import { Kind } from "graphql/language";
const typeDefs = /* GraphQL */ `
scalar Coordinates
scalar ObjectType
interface Geometry {
type: String!
coordinates: Coordinates
@lkleuver
lkleuver / index.html
Created September 21, 2017 11:57 — forked from RubaXa/index.html
String#includes vs. String#indexOf vs. RegExp (http://jsbench.github.io/#a4612afd0cd26e911ee8) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>String#includes vs. String#indexOf vs. RegExp</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
export function PromiseLimit(concurrency, promises) {
const count = promises.length;
concurrency = Math.min(concurrency, count);
let finished = 0;
const next = (resolve, reject) => {
let promise = promises.pop();
if (typeof promise === "undefined") {
if (finished === count) {
resolve();