Hey, I'm Dorayavailable for hire

My passion for productivity and creativity has driven my work on various projects, from front-end development to full-stack development and from desktop apps to mobile apps. I strive to push the boundaries of technology to streamline workflow for developers and enhance the experience for users.

githubhey@doray.dev
articles

Five Challenges When Using WebAssembly, Golang, and TypeScript

Five challenges encountered while using WebAssembly as a bridge between Golang and NodeJS runtimes. The issues include a WASM file compilation error, missing WASM import arguments, unavailable crypto.getRandomValues, declaring variables in globalThis in TypeScript, and treating Golang + WASM as an application instead of a library. The solutions include setting environment variables, importing wasm_exec.js file, providing a polyfill for crypto.getRandomValues, augmenting global type definitions, and using Golang's Channel to prevent the runtime from shutting down.

Caveats of ngVue: Using Vue2 Into AngularJS

The ngVue module allows you to use Vue components in AngularJS applications, making change detection efficient but complicated. AngularJS uses a dirty checking mechanism while VueJS uses a reactivity system. ngVue makes use of the reactivity system in the dirty checking mechanism, but has limitations in detecting changes to models. Solutions include using Vue.set() to add properties and Array.prototype.splice to mutate arrays.

Unary map(parseInt) to Fix the Not-A-Number Issue

The example of numbers.map(parseInt) in JavaScript shows how the Array.prototype.map method calls the provided parseInt function once for each element in the array and converts strings into integers. However, the actual result failed and made the last two elements NaN. This is because parseInt only defines two parameters: string and radix, and the third argument in numbers.map(parseInt) is ignored. Solutions include using Lodash's unary method or Vanilla JS's unary and ary-like functions, or simply using numbers.map(str => parseInt(str, 10)).