Skip to content

Instantly share code, notes, and snippets.

View neysidev's full-sized avatar
🦦
loading...

Mety neysidev

🦦
loading...
View GitHub Profile
@neysidev
neysidev / data.json
Created July 30, 2025 11:12
Frontend Technical Test Data
[{"title":"acceleration z1","data":[[53,-0.056],[58,null],[63,0.112],[68,null],[73,0.023],[78,-0.557],[83,-0.359],[88,-0.119],[93,-0.011],[98,-0.138],[102,null],[107,0.438],[113,0.232],[118,-0.321],[123,-0.381],[128,-0.13],[133,-0.007],[138,0.09],[143,-0.407],[148,-0.317],[153,null],[158,null],[163,0.027],[168,-0.059],[173,-0.059],[178,0.135],[183,0.774],[188,-0.276],[193,0.015],[198,0.789],[203,0.135],[208,-0.108],[213,0.124],[218,-0.018],[223,-0.359],[228,-0.026],[233,null],[238,-0.056],[243,-0.13],[248,-0.164],[253,-0.067],[258,null],[263,null],[268,0.139],[273,-0.213],[278,0.06],[283,0],[288,0.273],[293,0.112],[298,-0.392],[303,-0.37],[308,-0.818],[313,null],[318,null],[323,-0.336],[328,5.032],[333,null],[338,0.984],[343,-1.393],[348,-1.341],[353,0.681],[358,0.109],[363,-0.048],[368,-0.209],[373,0.453],[378,0.341],[383,null],[388,0.098],[393,0.004],[398,-0.937],[403,0.789],[408,-0.078],[413,-0.321],[418,null],[423,null],[428,null],[433,-0.448],[438,0.015],[443,null],[448,-0.31],[453,0.056],[458,-0.329],[4
@neysidev
neysidev / data.json
Last active July 30, 2025 00:40
PANTOhealth — Frontend Developer Technical Test
[{"title":"acceleration z1","data":[[53,-0.056],[58,null],[63,0.112],[68,null],[73,0.023],[78,-0.557],[83,-0.359],[88,-0.119],[93,-0.011],[98,-0.138],[102,null],[107,0.438],[113,0.232],[118,-0.321],[123,-0.381],[128,-0.13],[133,-0.007],[138,0.09],[143,-0.407],[148,-0.317],[153,null],[158,null],[163,0.027],[168,-0.059],[173,-0.059],[178,0.135],[183,0.774],[188,-0.276],[193,0.015],[198,0.789],[203,0.135],[208,-0.108],[213,0.124],[218,-0.018],[223,-0.359],[228,-0.026],[233,null],[238,-0.056],[243,-0.13],[248,-0.164],[253,-0.067],[258,null],[263,null],[268,0.139],[273,-0.213],[278,0.06],[283,0],[288,0.273],[293,0.112],[298,-0.392],[303,-0.37],[308,-0.818],[313,null],[318,null],[323,-0.336],[328,5.032],[333,null],[338,0.984],[343,-1.393],[348,-1.341],[353,0.681],[358,0.109],[363,-0.048],[368,-0.209],[373,0.453],[378,0.341],[383,null],[388,0.098],[393,0.004],[398,-0.937],[403,0.789],[408,-0.078],[413,-0.321],[418,null],[423,null],[428,null],[433,-0.448],[438,0.015],[443,null],[448,-0.31],[453,0.056],[458,-0.329],[4
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: eurotrucks2 [96634]
Path: /Volumes/*/Euro Truck Simulator 2.app/Contents/Game/Euro Truck Simulator 2.app/Contents/MacOS/eurotrucks2
Identifier: com.scssoft.ets2
Version: 1.22.2 (67890)
Code Type: X86-64 (Translated)
Parent Process: Exited process [96618]
function calculateAngle(point1, point2) {
const angleInRadians = Math.atan2(point2.y - point1.y, point2.x - point1.x);
const angleInDegrees = (angleInRadians * 180) / Math.PI;
return angleInDegrees;
}
function getStd(array) {
const n = array.length;
const mean = array.reduce((a, b) => a + b) / n;
return Math.sqrt(
array.map(x => Math.pow(x - mean, 2)).reduce((a, b) => a + b) / n
);
}
function findLineEquation(point1, point2) {
const slope = (point2.y - point1.y) / (point2.x - point1.x);
const yIntercept = point1.y - slope * point1.x;
return { slope, yIntercept };
}
function findCorrespondingY(point1, point2, x) {
const lineEquation = findLineEquation(point1, point2);
return lineEquation.slope * x + lineEquation.yIntercept;
}
// https://stackoverflow.com/questions/4959975/generate-random-number-between-two-numbers-in-javascript
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min)
}
const rndInt = randomIntFromInterval(1, 6)
console.log(rndInt)
import { useState } from "react";
const { REACT_APP_API_URL, REACT_APP_API_VERSION } = process.env;
const buildUrl = (pathname, query) => {
const apiUrl = `${REACT_APP_API_URL}api/v${REACT_APP_API_VERSION}`;
const url = new URL(apiUrl + pathname);
Object.keys(query).forEach(queryKey =>
url.searchParams.set(queryKey, query[queryKey].toString())
);
function getFields(array, fields = []) {
return array.map(item =>
fields.length === 1
? item[fields[0]]
: new Array(fields.length).fill(null).map((_, i) => item[fields[i]])
)
}
// How to use?
const arr = [{ id: 1, name: "Steve" }, { id: 2, name: "Bill" }]
const sleep = ms => {
return new Promise(resolve => {
setTimeout(resolve, ms);
})
}
// How to use?
await sleep(5000)