GreggHume

GreggHume @greggcbs

About: A developer who works with and on some of the worlds leading brands. My company is called Cold Brew Studios, see you out there :)

Joined:
Mar 10, 2021

GreggHume
articles - 26 total

AWS S3 Change Url, Proxy Url, Map to Domain in 2024

It is not hard to map your ugly s3 url to your domain so you can have nice urls to share with your...

Learn More 3 0Nov 22 '24

Prevent body from scrolling when a modal is open : css solution

The latest solution is to use css. We were graced with the overscroll-behavior property. But it is...

Learn More 1 0Sep 10 '24

Svelte 5: Slot / children example

Svelte 5 has deprecated the slot tag. So now you have to use children, but its not clear how to do...

Learn More 6 1Aug 21 '24

Whatsapp Webhook Setup and Nodejs Code Example

Solution If you are getting a validation error the problem is not with ngrok, localtunnel...

Learn More 16 0Jun 18 '24

Vite: How to bundle / group chunks together

If you use a library like Svelte or Vue you might have noticed that Vite and Rollupjs create tons of...

Learn More 9 0Jun 14 '24

Payfast API: Easy Nodejs signature and headers function

Lets be real, Payfast API is confusing and their documentation is too. If you want a nice reusable...

Learn More 5 0Jun 11 '24

CSS: Fix a div center on the page

Sometimes you need to fix an element that you want to stay within the bounds of a container. Or you...

Learn More 2 1Feb 2 '24

Strapi: Update user via api

To update a user via the api you can do the following: // route as...

Learn More 1 0Sep 19 '23

Strapi: Create user via api

The functionality to create a user via api in Strapi 4 is already built in. Its just that the route...

Learn More 10 0Sep 19 '23

Anyone else get bored of coding? How do you stay excited?

I am 35, I have been coding for 15 years and i am finding it boring now. How do you get past these...

Learn More 15 16Aug 7 '23

Nextjs: How to check device serverside or know if mobile

I have different components that I render on Mobile vs Desktop. I like to dynamically import...

Learn More 0 0Jul 17 '23

Nextjs: How to get url in getInitialProps

Heres the code: export const getInitialProps = ({ req, res, err }) => { let url = req ?...

Learn More 1 0Jun 14 '23

MongoDB: How to get fullDocument from changeStream when a document is deleted

In order to get the full document in a watcher after deleting the document you need to enable collMod...

Learn More 5 0Apr 14 '23

Nodejs: How much ram does a basic node app use?

The answer is: 32mbs of ram. I got this by setting up a basic node server (i am running node...

Learn More 2 0Feb 10 '23

Vue 3 and Vite: ignore custom components code example

This is how you ignore custom elements in Vue 3 and Vite: // vite.config.js import vue from...

Learn More 8 1Nov 4 '22

Vue 3, Nuxt 3 and Vite: Dynamic import components using api data

You want to dynamically import components based on some dataset or api call and perhaps wait for...

Learn More 9 9Oct 31 '22

Easily record microphone on all devices

I have had an array of issues with mediaRecorder: Audio doesnt play on all devices or...

Learn More 4 3Aug 24 '22

React: Page and router transitions

There are many articles online on how to do this, i found this one is the...

Learn More 6 0Aug 17 '22

Browser: Fetch API Cors settings for server wildcard origin

Cors issues are a pain, especially if your server is allowing all but fetch is still throwing errors....

Learn More 1 0Jul 20 '22

Google maps: MarkerClusterer and GridAlogrithm example

Here is an example of how to use the "@googlemaps/markerclusterer": // ...other imports and...

Learn More 9 0May 30 '22

Google map loader api, how to include libraries like places

You want to include "drawing" | "geometry" | "localContext" | "places" | "visualization"? Here you...

Learn More 6 0May 27 '22

Nuxt and Cloudflare, how to get SSR working (2 settings)

You have nuxt with cloudflare and might notice your pages are not server side rendering and are...

Learn More 0 0May 22 '22

Simplest way to loop node list / HTMLCollection using map, foreach etc

You spread the list like this: const elements =...

Learn More 7 0May 18 '22

Nuxt 2 dynamic sitemap with data from an api

You want to dynamically build your sitemap off some dataset / api then this is for you. Whether you...

Learn More 8 0May 16 '22

Lazy load images, native solution, no javascript or plugins

Browsers now have native functionality to lazy load images. Just add the loading attribute to your...

Learn More 3 2May 15 '22

jsonld in Nuxt 2, super simple, no plugins

On a page in the head method you can add jsonld like this: head() { return { script:...

Learn More 12 0Apr 26 '22