Skip to content

Instantly share code, notes, and snippets.

View petervavro's full-sized avatar

Peter V petervavro

View GitHub Profile
@petervavro
petervavro / konva-node.ts
Last active June 16, 2023 21:16
I would like to share my Konva Node.js wrapper for server-side generation in Next.js.
let Konva = require('konva');
let canvas = require('canvas');
// mock window
Konva.window = {
Image: canvas.Image,
devicePixelRatio: 1,
};
// mock document
@petervavro
petervavro / index-with-solution.js
Last active February 25, 2023 13:10
The solution for task to implement the function `SocialNetworkQueries#findPotentialLikes({ minimalScore })` per the requirements and make tests pass.

Introduction

Your task is to implement the function SocialNetworkQueries#findPotentialLikes({ minimalScore }) per the requirements and make tests pass.

Setup

  1. npm install – install dependencies
  2. npm test – run all tests once (this will be used to evaluate your solutions)
  3. npm run test:watch - run all tests in watch mode (optionally, you can use it locally if you prefer)