Setup
PUT doc-count-fun
POST doc-count-fun/_doc
{
"_doc_count": 10,
"@timestamp": "2023-09-14T10:00:00.477Z"
}
function mySlowFunction(baseNumber) { | |
console.time('mySlowFunction'); | |
let result = 0; | |
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) { | |
result += Math.atan(i) * Math.tan(i); | |
}; | |
console.timeEnd('mySlowFunction'); | |
} | |
mySlowFunction(8); // higher number => more iterations => slower |
PUT doc-count-fun
POST doc-count-fun/_doc
{
"_doc_count": 10,
"@timestamp": "2023-09-14T10:00:00.477Z"
}
Der kan max trækkes ca. 5000 boliger via api'et af gangen. Man er derfor nødt til at bruge pagination og filtering for at få det hele med.
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035},{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064}]}'
import React, { Component } from 'react'; | |
export default function withPropsChecker(WrappedComponent) { | |
return class PropsChecker extends Component { | |
componentWillReceiveProps(nextProps) { | |
Object.keys(nextProps) | |
.filter(key => { | |
return nextProps[key] !== this.props[key]; | |
}) | |
.map(key => { |
import { useRef } from 'react'; | |
let uniqueId = 0; | |
const getUniqueId = () => uniqueId++; | |
export function useComponentId() { | |
const idRef = useRef(getUniqueId()); | |
return idRef.current; | |
} |
// npm install http-proxy | |
var httpProxy = require('http-proxy'); | |
var targetHost = '192.168.99.100'; | |
var port = 8489; | |
httpProxy.createProxyServer({target:'http://' + targetHost + ':' + port}).listen(port); |
await
Cypress methodsGiven this backend task:
// plugins.ts
const plugin: Cypress.PluginConfig = (on, config) => {
on('task', {
async waitForMe(ms: number) {
return new Promise((resolve) => {