Simon Høiberg Profile picture
Aug 12, 2021 11 tweets 6 min read Read on X
JavaScript Utilities 🔧

This is a collection of useful code snippets that I use over and over.

Maybe they're useful to you as well.
Take away 👇
Create a unique string.
Great for quickly creating unique IDs.

👉 gist.github.com/SimonHoiberg/a…
Generate a random number in a range.
If you need to generate a random number between a minimum and maximum value.

👉 gist.github.com/SimonHoiberg/0…
Generate a number range.
It's one of the cool inbuilt utility functions in Python, but unfortunately, we're missing this in JavaScript.

👉 gist.github.com/SimonHoiberg/f…
Get the last item of either an Array, Set, Map or object.
Great for quickly accessing the last item dynamically without having to make any transformation.

👉 gist.github.com/SimonHoiberg/a…
Inserting, replacing, and removing items in a list is one of the things we do over and over.

I have these helpers (in TypeScript) that I use everywhere.

👉 gist.github.com/SimonHoiberg/c…
Create a deep clone of an object.
It does exactly what you would expect - creating a copy of an object, without any pointers to the original object.

👉 gist.github.com/SimonHoiberg/b…
Deep Freeze an object.
If you enjoy working with immutable JavaScript, this utility function is really handy.

👉 gist.github.com/SimonHoiberg/b…
If you've been working with the AWS SDK for Node.js, you probably know that the DynamoDB client returns entries in a quite annoying format.

Use this utility function to unwrap it into a normal-shaped object.

👉 gist.github.com/SimonHoiberg/4…
Sometimes you end up with a lot of Providers in React.
It can make your root component quite nested and hard to read.

Use this utility function to combine a list of Providers into a single Provider.

👉 gist.github.com/SimonHoiberg/8…
Working with async state updates in React often includes a bit of boilerplate.

I created this custom hook to deal with async state.
It optionally supports Recoil atoms as well.

👉 gist.github.com/SimonHoiberg/7…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Simon Høiberg

Simon Høiberg Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @SimonHoiberg

Mar 14, 2023
GPT-4 is about to launch 🚀
And we're going to see something groundbreaking!

According to early announcements, GPT-4 is going to be multimodal, which means both prompts and outputs can be:

→ Text
→ Images
→ Videos
→ Audio

Instead of simply text → text as we know now. Image
Let's gooo 🚀 Image
Read 4 tweets
Mar 13, 2023
How to validate your SaaS idea *before* you start building.

→ In less than 10 days
→ For less than $200
→ In 3 simple steps

Let's see how 🧵👇
Step 1: Set up a landing page.

Describe your product idea, the features, and the problem you want to solve.

Tools:
shuffle.dev to create the landing page
chat.openai.com to create the copy
figma.com to create the graphics
On the pricing page, include a simple form to join the waiting list for your product.

Use this to collect emails.

Tools:
zapier.com to handle form submissions
airtable.com to store the emails
Read 12 tweets
Jan 11, 2023
GPT-4 is going to launch soon.
And it will make ChatGPT look like a toy...

→ GPT-3 has 175 billion parameters
→ GPT-4 has 100 trillion parameters

I think we're gonna see something absolutely mindblowing this time!

And the best part? 👇
Average developers (like myself), who are not AI or machine learning experts, will get to use this powerful technology through a simple API.

Think about this for a second...

It's the most powerful, cutting-edge technology *in the world*, available through a Low-Code solution!
If you're not already planning on starting an AI-based SaaS or thinking about how to build AI into your current solution...

👉 Start now!

Cause this is gonna be one of the biggest opportunities of this century 🚀
Read 4 tweets
Dec 27, 2022
I run a 6-figure business entirely online.

But the amount of hats I need to wear is exhausting 🤯

Luckily, I can be a:
→ Copywriter
→ Data analyst
→ Social media manager
→ Head of Operations
→ Graphic designer
→ VP of Finance
→ Web developer

...using these 7 tools ↓
🔹 TubeBuddy

I couldn't imagine running YouTube as a business without TubeBuddy.

Keyword research, channel analytics, thumbnail analysis, A/B testing and much more.

🔗 tubebuddy.com
🔹 FeedHive

FeedHive is the ultimate tool for entrepreneurs who want to build a social media presence at scale.

I gained +200K followers across 5 different platforms in < 2 years.

I've seen people go viral with FeedHive more times than I can count.

🔗 feedhive.io
Read 9 tweets
Nov 28, 2022
8 No Code tools you can use to set up a SaaS business from scratch!

🌐 Website
⚙️ Web app
📱 Mobile app
🔁 Automation

(...I bet some of these are new to you)

Let's take a look ↓
🌐 Create a stunning website for your business!

→ Shuffe (shuffle.dev)
→ Versoly (versoly.com)
⚙️ Create the actual SaaS web application.

→ Bubble (bubble.io)
→ Wized (wized.io)
Read 7 tweets
Nov 8, 2022
How to validate your SaaS idea *before* you start building.

→ In less than 10 days
→ For less than $200
→ In 3 simple steps

Let's see how 🧵👇
Step 1: Set up a landing page.

Describe your product idea, the features, and the problem you want to solve.

Tools:
shuffle.dev to create the landing page.
copy.ai to create the copy.
figma.com to create the graphics.
On the pricing page, include a simple form to join the waiting list for your product.

Use this to collect emails.

Tools:
zapier.com to handle form submissions.
airtable.com to store the emails.
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(