Node.js dns.lookup() to internal docker-compose service

Issue I’ve try yo measure DNS latency in my docker-compose/kubernetes cluster. setInterval(() => { console.time(‘dns-test’); dns.lookup(‘http://my-service’, (_, addresses, __) => { console.log(‘addresses:’, addresses); console.timeEnd(‘dns-test’); }); }, 5000); But get addresses: undefined, any ideas? Solution …dns.lookup(‘http://my-service’… The lookup function (with example

Continue reading

Centering a SVG path

Issue is there a way to center my <path> in an SVG-File? This is my SVG: xml <svg xmlns=”http://www.w3.org/2000/svg” viewBox=”0 0 72 72″> <rect width=”100%” height=”100%” fill=”#444444″ /> <path d=”M5.7 0L1.4 10.985V55.88h15.284V64h8.597l8.12-8.12h12.418l16.716-16.716V0H5.7zm51.104 36.3L47.25 45.85H31.967l-8.12 8.12v-8.12H10.952V5.73h45.85V36.3zM47.25 16.716v16.716h-5.73V16.716h5.73zm-15.284 0v16.716h-5.73V16.716h5.73z” fill=”#6441A4″ /> </svg>

Continue reading

Why is mouseout and mouseleave always firing

Issue I really don’t get why the p element is always hidden (and therefore why the mouseout is always firing): const canvas = document.querySelector(“canvas”); const infoBox = document.querySelector(“#info-box”) canvas.addEventListener(“mousemove”, evt => { evt.preventDefault() infoBox.style.display=”block” infoBox.style.position=”absolute” infoBox.style.top= evt.clientY+”px” infoBox.style.left=evt.clientX+”px” console.log(“moved”) })

Continue reading

Jquery change <p> text programmatically

Issue EDIT: The solution was to add this to the profile page instead of the gender page. $(‘#profile’).live( ‘pageinit’,function(event){ $(‘p#pTest’).text(localStorage.getItem(‘gender’)); }); I have a paragraph with som text in a listview that I want to change programatically from another page

Continue reading

Highlight syntax in contenteditable

Issue I have a contenteditable div I want users to type in. When users type inside the box with onkeyup, I activate a function that changes the color of certain characters: var lTags = fixedCode.innerHTML.replace(/&lt;/gi, “<span style=’color:gold;’>&lt;</span>”); var rTags =

Continue reading

Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile

Issue I have updated node today and I’m getting this error: error: TypeError: Cannot read properties of undefined (reading ‘transformFile’) at Bundler.transformFile (/Users/…/node_modules/metro/src/Bundler.js:48:30) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (/Users/…/node_modules/metro/src/lib/transformHelpers.js:101:12) at async processModule (/Users/…/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:18) at async traverseDependenciesForSingleFile

Continue reading

Add aria-label to table header in datatable

Issue let checkboxColumn = `<div class=”checkbox c-checkbox” > <label> <input type=”checkbox” ng-model=”self.headerCheckBox” ng-change=”self.headerSelected()” /> <span class=”fa fa-check”></span> </label> </div>`; self.dtColumns = [ DTColumnBuilder.newColumn(“select”).withTitle(checkboxColumn).notSortable(), DTColumnBuilder.newColumn(“type”).withTitle(“Type”).notSortable().withClass(‘min-width-100’), DTColumnBuilder.newColumn(“ip”).withTitle(“Value”).notSortable().withClass(‘min-width-250’), ] I am creating a data table in which there is a checkbox in the

Continue reading

Angular Js ng-click not firing?`

Issue I’m having the weirdest issue getting ng-click to fire in my angular app. Here’s what I’m dealing with: <div class="popup" id="perks-popup" ng-if="perksPopup === true"> <div class="popup-bkg" ng-click="perksPopup = false;"></div> <div class="popup-content"> <div class="popup-close" ng-click="perksPopup = false;"> <img class="scalableImg" src="img/icons/close-blue.png"

Continue reading