Full-time coder, part-time drummer. Enjoys using and building software on the web, and is a massive fan of JavaScript.
Do you need to create a drag and drop file upload component in React? This blog post has you covered. Build a component that listens to drag events, handles drops, and falls back to the traditional file picker.
Written by Codemzy in Code on March 2nd, 2022
Want the convenience of easy access to a sticker header, without it getting in your way all of the time? Here's how you can hide your sticky header when scrolling down, and get it back as soon as you scroll up!
Written by Codemzy in Code on February 23rd, 2022
In this blog post, I share a ReactJS hook you can use to listen to the scroll direction of the browser. Is the user going up or down the page? Now you can always know! Unless they stay still!
Written by Codemzy in Code on February 9th, 2022
Regex groups are super useful when you need to replace specific patterns in strings. In this blog post, discover how to use multiple groups to perform simple (and complex) replacements.
Written by Codemzy in Code on February 2nd, 2022
Take your regex further by breaking it down and accessing specific parts of your match with groups. Find out how you can create and use groups inside your regex with match() and matchAll().
Written by Codemzy in Code on January 12th, 2022
Transform your strings with regex, and be amazed at how your JavaScript code changes. This is the key to successfully tidying and validating your data. Regex will not only transform your code, it will change you and your strings too.
Written by Codemzy in Code on December 22nd, 2021
Image files can get big, so you might want to think about reducing image sizes when you let users upload photos on your website. Here's how you can use npm packages like sharp and multer to handle files and images in Node.js.
Written by Codemzy in Code on December 15th, 2021
TextEdit might seem like a basic text editor. It is simple to use, with a minimal design, but it does more than it first appears. You can use the Insert Pattern feature in Find and Replace to get a word count, character count, and some pretty complex replacements!
Written by Codemzy in Software on December 1st, 2021
On static sites, your back end is totally separate from your front end. But you might be leaking information with your API calls. Here's how you can use Netlify redirects to reverse proxy to your back end services (and why you might want to).
Written by Codemzy in Deploy on November 24th, 2021
Do you want to build a static website without learning another javascript framework? If you already know ReactJS, you can use it to create your static HTML content. It's quick and easy, and you won't even need to configure Webpack to do it! Use renderToStaticMarkup().
Written by Codemzy in Code on November 17th, 2021
Static sites means static content, right? But if you run a blog, you might want to schedule content to maximise your productivity and consistency. Let's look at how you can schedule your posts for the future by adding dates and updating your build process.
Written by Codemzy in Code on November 10th, 2021
All the best static site providers give you continuous deployment from Git. But what about your images files? Should you store them in your Git repository too? Noooo! Don't do it! Here are some solutions for image storage without bloating your repository.
Written by Codemzy in Deploy on November 3rd, 2021
How can you schedule static site builds? Run a cron job! But if you don't have a server, how do you run a cron job? Do you need an extra tool or service? If you already store your code on GitHub, you have everything you need. Say hello to GitHub Actions.
Written by Codemzy in Deploy on October 28th, 2021
NaN isn't something you will often (if ever) write into your code. But it can crop up from time to time. And when it does, you can't check for it in the same way you could check for other values. Because NaN does not equal NaN. Are you confused? Don't be! Let's get to know NaN.
Written by Codemzy in Code on October 25th, 2021
I recently updated a bunch of npm packages on one of my websites and got rid of over 30 vulnerabilities. I was over the moon - until my Netlify builds started failing. And the problem was my Node version. Here's how I found the problem and fixed it.
Written by Codemzy in Deploy on October 21st, 2021
Dark Mode has taken over our devices, and now it's taking over the internet. Mostly at night time. It is possible to add Dark Mode to a static site without white flashes or impacting performance. Here's how I added Dark Mode to a static site with a little bit of JavaScript.
Written by Codemzy in Code on October 18th, 2021
I built a static blog builder, so you don't have to! You can set up a fully functioning blog on your own domain in 5 minutes. Create posts with Markdown. You can also add custom pages with ReactJS and custom styles with TailwindCSS (if you want to get fancy!).
Written by Codemzy in Projects on October 15th, 2021