Recently at work, We were looking for a way to generate unique IDs across a distributed system that could also be used as the primary keys in the MySQL tables.
We knew in a single MySQL database we can simply use an auto-increment ID as the primary key, But this won’t work in a sharded MySQL database.
So I looked at various existing solutions for this and finally learned about Twitter Snowflake — a simple 64-bit unique ID generator.
UUIDs are 128-bit hexadecimal numbers that are globally unique. The chances of the same UUID getting generated twice are negligible.
What is 1+2? Ah, who doesn’t know, it’s 3. What is 1+2+3? Well, it’s 6. (easy peasy lemon squeezy)
Now, what if I asked you to count the sum of all positive integers which is: 1+2+3+4…to infinity?
That’s it. This is the crux of this blog post.
Wait a minute, what?
All positive numbers when add up together should be infinite, right?
But now what if I tell you, there is a definite answer for this and it’s not something indefinite like infinity.
It has a fixed value assigned to it🤯
In this blog post, I am going to give…
This is one of the most used operators when I have to deal with large numbers. When using a separator (with just an _) in number it looks better than an unseparated number.
let number = 98234567
let number = 98_234_567
And it works for any other numeric base as well:
const binary = 0b1000_0101;
const hex = 0x12_34_56_78;
Few caveats :
let num= 100__00
❓ Did you know you can’t name a file “Con” in Windows
If you’re running a Windows machine, try it right now. Go to File Explorer -> create a new folder -> name it “Con”
Did it work? Now try with “PRN”, “AUX” or “NUL”. What did you get?
Probably this ⬇
In this article, we will see what’s the difference between a Nullish Coalescing Operator (??) and a Logical OR (||)
Here are few examples 👇
const value1 = 1;
const value2 = 2;const result = value1 || value2;console.log(result); // 1
Both value1 and value2…
FizzBuzz is the most popular coding problem, and perhaps also one of the easiest.
For those of you who don’t know, here’s the problem statement :
Write a short program that prints each number from 1 to 100 on a new line. For each multiple of 3, print “Fizz” instead of the number. For each multiple of 5, print “Buzz” instead of the number. For numbers that are multiples of both 3 and 5, print “FizzBuzz” instead of the number.
Recently, Digital collectibles have exploded in popularity because of NFTs. You’ve probably seen people in your social media feeds talking about NFTs too.
The growing market for NFT is turning the art, music, gaming, and finance industries upside down.
NFTs can be confusing to understand for someone who is hearing it for the first time.
So today let’s unwrap what is NFT and why suddenly it is becoming the next big thing on the Internet.
We will be running through everything you need to know about them.🙂
You’re probably familiar with this famous tweet by Jack Dorsey, the billionaire co-founder…
As a developer, we use GitHub every day and it is already a great tool, but what if we can make it even better with some chrome extensions!
Let’s have a look at some of them 🔽
It enhances GitHub code review and exploration with features like:
I like this extension very much! It lets you explore the files and folders of a repository with a tree like structure.
Learning web development is like learning to drive a car. No matter how much you do not enjoy it, learning these skills sometimes can help you a lot and can even act as a great skill to put on your resume.
I needed to create some landing pages, custom logos, and mockups.
So I decided to go through all these technologies once again and during that process, I found…