October 22, 2024
Chicago 12, Melborne City, USA
javascript

Styled Unicode Characters to Plain Text

I have this code that converts plain text to Unicode styled characters: function convertText(text, style) { // 1. Convert the text to the bold type with the unicode. const conv = { c: function(text, obj) {return text.replace(new RegExp(`[${obj.reduce((s, {r}) => s += r, "")}]`, "g"), e => { const t = e.codePointAt(0); if ((t >=

Read More
javascript

Overlapping lines weeks

I have datasets with date time as x-axis. I did split the datas by weeks like "2024W41", "2024w42"… I would like to display two lines, one for each week. Sadly, as its based on date for x-axis, the first week appears left, the second one appears next, to the right of it. Its logical. How

Read More
javascript

Textarea doesn't display the encoded output correctly

I get user input from textarea and handle it on the server where it’s encoded with base64 and stored in a database, but for some reason there seems to be an encoding error when loading that content back into a textarea. The problem is that i my case quotation marks ' and " get encoded

Read More
javascript

[slug]/page.tsx re-renders static elements

i am creating a docs page in next.js using .mdx files. in my docs pages it has two elemnts: <div className={'flex flex-row'}> <DocsNav/> <div className={'flex flex-col'}> <EditPage docName={params.slug.toString()}/> <div className={'my-4'}>{content}</div> </div> </div> now what’s happening is when i click on a new docs link, it shifts me from one docs page to another, but the

Read More
javascript

Remix, Supabase Oauth: OAuth error: AuthApiError: invalid request: both auth code and code verifier should be non-empty

I am trying to implement oAuth (Github in this case) in my Remix.run app using Supabase. This is my signup action: export const signupWithOAuth = async ({ request, provider, }: { provider: 'google' | 'github' request: Request }) => { const { supabaseClient } = createSupabaseServerClient({ request }) const { data, error } = await

Read More
javascript

Able to read from google sheet but unable to write to google sheet using Javascript

I’m able to read rows from my google sheet, but unable to write to it (append rows).. That probably means that I’m clear on the whole authentication business right? Below is my code for trying to write to the first two cells of my sheet. I don’t get any error message, I get a message

Read More
javascript

Angular 18 – CropperJS not working properly on image upload

I’m having issues trying to use cropperjs package – https://www.npmjs.com/package/cropperjs. I’m using it in a angular18 project. The image is being uploaded and sent to the cropper but the cropper does not let me crop the image, it only shows the image. I have 2 components, one for the user to upload the image and

Read More
javascript

Audio Recording Javascript Chrome extension working with Youtube but not working on Google Meet Mic to record audio

I have fully working code which starts, stop recording audio from a tab. It also plays and download the most recent recorded audio. I tested it both Youtube and Google Meet. It captures the speaker output but when I try to capture mic audio from Google Meet, it fails. What should I be modifying in

Read More
javascript

How can I count how many times a function argument has been used in JS?

I need to construct a function, which takes a black-box one-argument function as an argument. And I need to know, how many times the black-box function uses its argument Example signature: function argCounter(fn) { return (arg) => { let argCalls = 0 ... fn(arg) return argCalls } } Example use: const fn1 = argCounter(obj =>

Read More
javascript

Any way to capture the deleted text in a tracked change using the Word.js API?

The Word.TrackedChange.Text property seems to return an empty string when the tracked change is a deletion. Is there any way to get the deleted text? Thanks! You need to sign in to view this answers

Read More