teleren/devto huggingface dataset:
Metaverse NFT Marketplace Development - Peek into the Future
Tags: metaverse, nft, beginners, business
Published: 2022-05-06 09:58:04

Metaverse-based NFT marketplaces are attracting more global audiences than normal NFT marketplaces and transactions in the metaverse are reaching record highs. Metaverse NFT Marketplace is a concept of integrating NFT marketplaces into the metaverse so that it helps users to buy lands, in-game items, and digital arts inside the metaverse. By developing such metaverse projects enterprises are gaining huge returns on investment within a short time frame. There are a large number of use cases such as,

- Metaverse Gaming NFT marketplace
- Metaverse Real estate NFT marketplace
- Metaverse E-Commerce NFT marketplace

## How to Create a Metaverse NFT Marketplace?

I assume you have already gone through what is Metavsere NFT Marketplace. Here we will explore the steps involved in building a Metaverse marketplace,

1. Picking the Right blockchain
2. User Interface Development
3. Features Integration
4. Smart Contract Creation
5. IPFS and Database Creation
6. Front End & Back-End Integration
7. Smart Contract Auditing
8. Quality Testing and Deployment

Above is an overview of the development stages. Read the detailed insights here: **[How to Create a Metaverse NFT Marketplace](https://maticz.com/metaverse-nft-marketplace-development)**

If you are an individual business, start-up, or enterprise looking to create a new or customize the existing Metaverse project? we are happy to help you. 

## Metaverse NFT Marketplace Development

With extensive experience in developing NFT and Metavsere products, Maticz a **[best NFT development company](https://maticz.com/nft-development-company)** helps startups, and enterprises to create their own Metaverse NFT marketplace for diverse industries such as Real Estate, Gaming, Ecommerce, etc. We provide a full cycle Metaverse NFT marketplace development services such as,

- Metaverse 3D Environment Development
- NFT Marketplace Development
- NFT Development
- Smart Contract Creation and Integration
- Upgradation and Migration

Best project ideas need the best technical expertise team. Maticz can help you with its development team. Connect with our Metavsere experts and share your development requirements.
Network Connectivity Use Cases on Google Cloud
Tags: googlecloud, sitetosite, sitetocloud, vpctovpc
Published: 2022-05-06 09:54:27

Enterprises today have a 𝙫𝙚𝙧𝙮 𝙗𝙧𝙤𝙖𝙙 𝙢𝙞𝙭 𝙤𝙛 𝙣𝙚𝙩𝙬𝙤𝙧𝙠𝙨 —
(1) from 𝙎𝘿-𝙒𝘼𝙉𝙨,
(2) dedicated WANs such as 𝙈𝙋𝙇𝙎,
(3) 𝙘𝙡𝙤𝙪𝙙 𝙞𝙣𝙩𝙚𝙧𝙘𝙤𝙣𝙣𝙚𝙘𝙩𝙨,
(4) to 𝙑𝙋𝙉𝙨.

At the same time, they’re 𝙢𝙤𝙫𝙞𝙣𝙜 𝙩𝙝𝙤𝙨𝙚 𝙒𝘼𝙉𝙨 𝙩𝙤 𝙩𝙝𝙚 𝙘𝙡𝙤𝙪𝙙 to take advantage of:
(1) the 𝙛𝙖𝙨𝙩𝙚𝙧 𝙩𝙪𝙧𝙣-𝙪𝙥,
(2) 𝙡𝙤𝙬𝙚𝙧 𝙘𝙤𝙨𝙩, and
(3) increased 𝙛𝙚𝙖𝙩𝙪𝙧𝙚 𝙫𝙚𝙡𝙤𝙘𝙞𝙩𝙮.

As 𝙬𝙤𝙧𝙠𝙡𝙤𝙖𝙙𝙨 𝙢𝙞𝙜𝙧𝙖𝙩𝙚 𝙩𝙤 𝙩𝙝𝙚 𝙘𝙡𝙤𝙪𝙙 and multi-cloud environments, Google believes that it’s critical to simplify enterprises’ networking model.

A 𝙘𝙡𝙤𝙪𝙙 𝙥𝙧𝙤𝙫𝙞𝙙𝙚𝙧 needs to provide three 𝙢𝙖𝙞𝙣 𝙩𝙮𝙥𝙚𝙨 𝙤𝙛 𝙘𝙤𝙣𝙣𝙚𝙘𝙩𝙞𝙫𝙞𝙩𝙮:

(1) 𝙎𝙞𝙩𝙚-𝙩𝙤-𝙘𝙡𝙤𝙪𝙙  🏢 ☁️
Between 𝙤𝙣-𝙥𝙧𝙚𝙢𝙞𝙨𝙚𝙨 𝙚𝙦𝙪𝙞𝙥𝙢𝙚𝙣𝙩 𝙖𝙣𝙙 𝙘𝙡𝙤𝙪𝙙 𝙧𝙚𝙨𝙤𝙪𝙧𝙘𝙚𝙨

(2) 𝙎𝙞𝙩𝙚-𝙩𝙤-𝙨𝙞𝙩𝙚  🏢 ☁️ 🏢
To connect 𝙤𝙣-𝙥𝙧𝙚𝙢𝙞𝙨𝙚𝙨 𝙧𝙚𝙨𝙤𝙪𝙧𝙘𝙚𝙨 together

(3) 𝙑𝙋𝘾-𝙩𝙤-𝙑𝙋𝘾 ☁️ ☁️
Connectivity 𝙗𝙚𝙩𝙬𝙚𝙚𝙣 𝙘𝙡𝙤𝙪𝙙 𝙧𝙚𝙨𝙤𝙪𝙧𝙘𝙚𝙨

Thanks to Olivier Vautrin and Tony Sarathchandra for their blog post:
𝘼 𝙛𝙤𝙘𝙪𝙨 𝙤𝙣 𝙣𝙚𝙩𝙬𝙤𝙧𝙠 𝙘𝙤𝙣𝙣𝙚𝙘𝙩𝙞𝙫𝙞𝙩𝙮 𝙪𝙨𝙚 𝙘𝙖𝙨𝙚𝙨 𝙞𝙣 𝙩𝙝𝙚 𝙘𝙡𝙤𝙪𝙙
https://cloud.google.com/blog/products/networking/understanding-cloud-network-connectivity-use-cases

𝙎𝙩𝙖𝙮 𝙩𝙪𝙣𝙚𝙙 𝙗𝙮 𝙛𝙤𝙡𝙡𝙤𝙬𝙞𝙣𝙜
https://www.linkedin.com/feed/hashtag/didAbRyouAbRknowAbRthat/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0ekmar7ykwi6bp7e51e.jpg)
What Developers Have To Know About UI/UX
Tags: design, ux, uxui, developers
Published: 2022-05-06 09:42:09

{% youtube pMFuz3Wnbk8 %}

What should developers know about UI and UX design? How to communicate with designers? Let’s build a better workflow - check what skills and tools devs should be aware of.

Enjoy! You can also read the article at [Frontend House](https://frontendhouse.com/experts-zone/what-developers-have-to-know-about-uiux-experts-zone-21).
Have you built your Github portolio?
Tags: github, readme, portfolio
Published: 2022-05-06 09:36:21

I just updated my **Github portfolio** and got really happy. Guess my happiness level is very shallow 😂

You can check my portfolio [here](https://github.com/KarmaBlackshaw)

You should build your portfolio as well. Here's a list of resources I used in building mine:

- [Dillinger](https://dillinger.io/)
- [Shields](https://shields.io/)
- [Antonkomarev](https://github.com/antonkomarev/github-profile-views-counter)
- [Wakatime](https://wakatime.com)
- [Badges](https://badges.pufler.dev)
- [Spotify](https://spotify-github-profile.vercel.app)
- [Ryo Ma](https://github.com/ryo-ma/github-profile-trophy)
- [Github Readme Stats](https://github-readme-stats.vercel.app)
- [SVG Porn](https://svgporn.com/)

Do you have any other resources used when you built yours? Comment it down below 😀
Generating an APK in React Native CLI
Tags: reactnative, react, android
Published: 2022-05-06 09:27:41

## React Native
 has gained popularity over the years, with the whole concept of cross-platform development developer has flocked to it. l am one of the developers. l started React Native about 2 years ago and l did a bit of CLI before loving Expo

> Debate is still on about what is better CLI or Expo.

After a while not using CLI, l ended up wanting to use it for some project. l settled my Android environment and everything but everytime l wanted to generate a stand alone debug apk using `gradlew assembleDebug` it would build an apk that still required the Metro server. l mean how absurd. l tried building it in Android Studio and same issue came up.

l discovered that they now commented some build features in `/android/app/build.gradle `file. They are now optional and everytime you want a standalone apk you need to uncomment some few lines.

For example these lines preceeding the hemes engine use in build:

```
bundleInDebug: true,
bundleAssetName: "index.android.bundle
```

So l thought of sharing this, if anyone ever get confused to as what's happening. Thank you for reading!
How to update ECS Tasks Revisions with AWS CLI
Tags: ecs, docker, fargate, aws
Published: 2022-05-06 09:14:47

Updating **ECS Tasks Image Versions** is not the easiest task if you don't go to the **AWS Web UI**. Also, there is not a direct code in order to do this in the **AWS CLI**. That's why I came up with the following code that supports you doing this without major effort.

The only prerequisites are:

- A machine with WSL2 (I only tested in Ubuntu), Linux, or macOS.
- Install **jq** (**sudo apt-get install jq**).
- Create a **.sh** file with the following script.

```
TASK_NAME=task_name
SERVICE_NAME=service_name
IMAGE_NAME=image_name
CLUSTER_NAME=cluster_name
REGION=region
VERSION=version
ACCOUNT_NUMBER=account_number

NEW_IMAGE=$ACCOUNT_NUMBER.dkr.ecr.$REGION.amazonaws.com/$IMAGE_NAME:$VERSION
TASK_DEFINITION=$(aws ecs describe-task-definition --task-definition "$TASK_NAME" --region "$REGION")
NEW_TASK_DEFINITION=$(echo $TASK_DEFINITION | jq --arg IMAGE "$NEW_IMAGE" '.taskDefinition | .containerDefinitions[0].image = $IMAGE | del(.taskDefinitionArn) | del(.revision) | del(.status) | del(.requiresAttributes) | del(.compatibilities) | del(.registeredAt) | del(.registeredBy)')
NEW_REVISION=$(aws ecs register-task-definition --region "$REGION" --cli-input-json "$NEW_TASK_DEFINITION")
NEW_REVISION_DATA=$(echo $NEW_REVISION | jq '.taskDefinition.revision')

NEW_SERVICE=$(aws ecs update-service --cluster $CLUSTER_NAME --service $SERVICE_NAME --task-definition $TASK_NAME --force-new-deployment)

echo "done"
echo "${TASK_NAME}, Revision: ${NEW_REVISION_DATA}"
```

After this, you need to update the environment variables:

- **TASK_NAME**=task_name
- **SERVICE_NAME**=service_name
- **IMAGE_NAME**=image_name
- **CLUSTER_NAME**=cluster_name
- **REGION**=region
- **VERSION**=version
- **ACCOUNT_NUMBER**=account_number

And then you run the **.sh** like this, **./update_task.sh**. A0nd that's all!


### Follow me on:

|  Personal  |  LinkedIn  |YouTube|Instagram|Cyber Prophets|Sharing Your Stories
|:----------|:----------|:------------:|:------------:|:------------:|:------------:|
|[![Personal](https://raw.githubusercontent.com/FANMixco/federiconavarrete/master/img/favicons/favicon.png)](https://federiconavarrete.com)|[![LinkedIn](https://i.stack.imgur.com/idQWu.png)](https://www.linkedin.com/in/federiconavarrete)|[![YouTube](https://i.stack.imgur.com/CFPMR.png)](https://youtube.com/c/FedericoNavarrete)|[![Instagram](https://i.stack.imgur.com/PIfqY.png)](https://www.instagram.com/federico_the_consultant)|[![RedCircle Podcast](https://i.stack.imgur.com/4XICF.png)](https://redcircle.com/shows/cyber-prophets)|[![RedCircle Podcast](https://i.stack.imgur.com/4XICF.png)](https://redcircle.com/shows/sharing-your-stories)|

[![sponsor me](https://raw.githubusercontent.com/FANMixco/Xamarin-SearchBar/master/bmc-rezr5vpd.gif)](https://www.buymeacoffee.com/fanmixco)
Manage .env files in bitbucket pipeline
Published: 2022-05-06 08:36:49

---
title: Manage .env files in bitbucket pipeline
published: true
description: I am creating docker images through bitbucket pipeline, I have multiple environment files (ie .env.dev, .env.production, .env.e2e etc) How can i manage it without eposing my data in repository
tags: 
---
Optimizing database query - In a loop
Tags: sql, database, javascript
Published: 2022-05-06 08:13:02

Imagine you have an array of object
but in the array, some object can have multiple data
for example
```
const transactions = [
	{
		"player_id": 1,
		"transaction_id": "xxx",
		"amount": "100",
	},
	{
		"player_id": 2,
		"transaction_id": "xxx",
		"amount": "100",
	},
	{
		"player_id": 3,
		"transaction_id": "xxx",
		"amount": "100",
	},
	{
		"player_id": 1,
		"transaction_id": "xxx",
		"amount": "100",
	}
]
```
and then you need to get the player information from the database
```
for (let i = 0; i<= transactions.length; i++) {
	const player = PlayerModel.findByPk(transactions[i].player_id)
// equals to SELECT * FROM users WHERE player_id = 1

	const saveTransaction = TransactionModel.create({
		id: transactions[i].transaction_id,
		player_id: transactions[i].player_id,
		player_before_balance: player.balance,
		player_after_balance: player.balance - transactions[i].amount
	});
}
```
you'll be creating database tcp connection in each loop, and that would be bad for the performance (more bad if your database is on another host)
because on every call you make, the flow goes like
```
open the db connection -> execute the query -> close the connection
```

so instead of using that way, you can distinct the transactions array by the player_id
```
const distinctPlayers = [...new Set(transactions.map(transaction => transaction.player_id))] 
// result [1,2,3]
```
the you will just call the database query only 1 time, using where in clause and store it in a variable
```
const players = PlayerModel.findAll({
		where: {
			id: distinctPlayers
		}
	})
// equals to SELECT * FROM users WHERE player_id IN (1,2,3)

for (let i = 0; i<= transactions.length; i++) {
	const player = players.find(player => player.player_id === players.player_id);

	const saveTransaction = TransactionModel.create({
		id: transactions[i].transaction_id,
		player_id: transactions[i].player_id,
		player_before_balance: player.balance,
		player_after_balance: player.balance - transactions[i].amount
	});
}
```

but the downside is, if the array is too large
the memory will take too much

please tell me if you have better approach
Github commits.Why a good commit message is important?
Tags: github, frontenddevelope, javascript, react
Published: 2022-05-06 08:10:13

When you work on a personal project your commits are yours but when you work on a team or contribute to open source. A well-crafted commit message can clearly communicate to other developers working on that project what you tried to perform with the codebase by just reading that message.
git commit -m "fix:( Authentication ) authorization issue in login page "

the structure of good commit is 👇

" <type>[optional scope]: <description> "

📍<type> - of commit helps in understanding the nature of commit whether it is a Feature,Fix, Refactor etc.

📍<scope> - can be used to categorize your commit, you can also use this to mention your folder name.

📍<description> : a short description for your commit.

this commit now can clearly give your teammate the context of what type of change you did, what is the scope change it has and a little description is like the cherry on the cake.

Hope this will help you in writing a better commit next time 😊

Adding the links of a few standard commit conventions you can follow.

If you have used more good commit conventions other than those, just drop them in the comments.
A Fun Programming Joke To Start Your Day
Tags: jokes, dailydeveloperjokes
Published: 2022-05-06 08:00:24

---
title: "A Fun Programming Joke To Start Your Day"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259582acfe.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why did the developer have to quit smoking?

___A:___ Because they couldn't afford to pay the new syntax.
 -->
Free & Open source admin template for Chakra UI & React with NFTs Marketplace, Kanban, Sign In...!
Tags: react, opensource, showdev, webdev
Published: 2022-05-06 07:58:44

Hello guys! I made this free & open source admin template for Chakra UI & React that comes with NFTs Marketplace, Kanban, Sign In, Analytics and many more! Check it out on the links below! 😊

- Live demo: https://horizon-ui.com/horizon-ui-chakra/
- Download on Github: https://github.com/horizon-ui/horizon-ui-chakra
Python: Logging from multiple modules
Tags: python, logging, softwaredevelopment, python3
Published: 2022-05-06 07:55:39

Hi, In one of my tasks at work I was designing a system where there would be one main module of my application and the application had several modules all of which did their part to make the application record success or failure.

However, at the time I did not know how to have python log the generated messages from multiple modules to the same logger object that was initiated in the main module. Hence this post.

Let us say your application looks like the below

The main application file should look as below:

```
import logging
#Function to initialize the logger, notice that it takes 2 arguments
#logger_name and logfile
def setup_logger(logger_name,logfile):
                logger = logging.getLogger(logger_name)
                logger.setLevel(logging.INFO)
                # create file handler which logs even debug messages
                fh = logging.FileHandler(logfile)
                fh.setLevel(logging.INFO)
                # create console handler with a higher log level
                ch = logging.StreamHandler()
                ch.setLevel(logging.INFO)
                # create formatter and add it to the handlers
                formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
                fh.setFormatter(formatter)
                ch.setFormatter(formatter)
                # add the handlers to the logger
                logger.addHandler(fh)
                logger.addHandler(ch)
                return logger
#setup the logger as below with mylogger being the name of the #logger and myloggerfile.log being the name of the logfile
mylogger=setup_logger('mylogger','myloggerfile.log')
mylogger.info("My Logger has been initialized")
##########Very important to import the module after the logger has #been created, if the module is imported before setting up the #logger the module wont log to the desired file
import mymodule
#Then you can continue the rest of the code.
```

The module file should look like below:
```
import logging
hostlogger = logging.getLogger('mylogger.module')
hostlogger.info("Logger has been initialised in the host module")
```

This should help you get logs from the modules of your applications into a single common file as below:

```
# cat myloggerfile.log
2022-05-05 17:06:10,024 - mylogger - INFO - My Logger has been initialized
2022-05-05 17:06:10,028 - mylogger.module - INFO - Logger has been initialised in the host module

```
Notice the name of the logger object, the message with the tag mylogger is coming from you main application and the message mylogger.module is coming from the module

This can also be tweaked to log to multiple files and have multiple logger objects created in the main application file and the modules can refer to them accordingly.
Why LinkedIn Sucks and How Should We Be Using It?
Tags: discuss, career, watercooler
Published: 2022-05-06 07:15:23

I've recently read a post by @shareef on [why he doesn't use LinkedIn](https://dev.to/shareef/why-i-dont-use-linkedin-and-why-you-should-also-4k52) and it highlighted a lot of pain points I myself have experienced on LinkedIn as well.

And while people agreed with Shreef, there's also a lot of people who have had success with the platform. So it got me thinking, what is the best way to use LinkedIn?

## The Promise 🌅

Oh LinkedIn. The promise of a platform for aspiring professionals to progress their careers by getting exposed to new career opportunities and build a network of like minded professionals.

## Reality 💀

In recent times my experience with LinkedIn has been terrible to say the least. Some reasons include: 
* Constant posts about showing off success such as "I just bought a car" or "check out my latest certification" to gain some cheap validation... I mean to motivate others to push through on their journey on not give up.💪
* Irrelevant jobs postings getting spammed in my inbox like "Hi Chadwin. We're looking for a Senior React Developer with 8 - 10 years experience" despite me just starting out. 
* Engagement bait through quotes, memes and asking people to react on a post if, for example, leave a like if you're feel motivated today.
* And promoted posts of Career Coaches trying to get us past the resume phase for the low price of being added to their mailing list. 

It's clear to see that there's not that much value on LinkedIn these days. And I'm sure that I'm not the only person that has been experiencing this. 

## The other side 💸

Now that I've got all that negativity out of my system, I've also seen and heard of people who have been getting immense success out of LinkedIn. Whether it be finding clients, building a solid network of like minded people etc.

**So I'm keen to hear from you. What is the best way to use LinkedIn? And is it even worth it in 2022?**
Google Cloud for SAP Landscapes
Tags: googlecloud, sap, modernization, migration
Published: 2022-05-06 07:07:16

There are 𝙨𝙚𝙫𝙚𝙣 𝙧𝙚𝙖𝙨𝙤𝙣𝙨 why 𝘾𝙤𝙣𝙨𝙪𝙢𝙚𝙧 𝙋𝙖𝙘𝙠𝙖𝙜𝙚𝙙 𝙂𝙤𝙤𝙙𝙨 (𝘾𝙋𝙂) companies choose Google 𝘾𝙡𝙤𝙪𝙙 for:
(1) 𝙢𝙤𝙙𝙚𝙧𝙣𝙞𝙯𝙞𝙣𝙜 𝙩𝙝𝙚𝙞𝙧 SAP 𝙡𝙖𝙣𝙙𝙨𝙘𝙖𝙥𝙚𝙨 and
(2) 𝙪𝙣𝙡𝙤𝙘𝙠𝙞𝙣𝙜 𝙖𝙜𝙞𝙡𝙞𝙩𝙮 𝙖𝙣𝙙 𝙞𝙣𝙣𝙤𝙫𝙖𝙩𝙞𝙤𝙣 across the entire business with Google Cloud

The reasons are:
(1) Make 𝙨𝙢𝙖𝙧𝙩𝙚𝙧 𝙙𝙚𝙘𝙞𝙨𝙞𝙤𝙣𝙨
(2) 𝙇𝙤𝙬𝙚𝙧 𝙏𝘾𝙊 by 30%
(3) Get the best of Google’s 𝙘𝙤𝙣𝙨𝙪𝙢𝙚𝙧 𝙞𝙣𝙣𝙤𝙫𝙖𝙩𝙞𝙤𝙣
(4) Benefit from 𝙥𝙧𝙤𝙫𝙚𝙣 𝙍𝙊𝙄
(5) Ease 𝙙𝙞𝙜𝙞𝙩𝙖𝙡 𝙩𝙧𝙖𝙣𝙨𝙛𝙤𝙧𝙢𝙖𝙩𝙞𝙤𝙣 𝙬𝙞𝙩𝙝 𝙎𝘼𝙋
(6) Run 𝙨𝙪𝙨𝙩𝙖𝙞𝙣𝙖𝙗𝙡𝙮 𝙬𝙞𝙩𝙝 𝙩𝙝𝙚 𝙘𝙡𝙚𝙖𝙣𝙚𝙨𝙩 𝙘𝙡𝙤𝙪𝙙
(7) Solve for the 𝙢𝙤𝙨𝙩 𝙘𝙝𝙖𝙡𝙡𝙚𝙣𝙜𝙞𝙣𝙜 𝙬𝙤𝙧𝙠𝙡𝙤𝙖𝙙𝙨

𝙎𝙩𝙖𝙮 𝙩𝙪𝙣𝙚𝙙 𝙗𝙮 𝙛𝙤𝙡𝙡𝙤𝙬𝙞𝙣𝙜
https://www.linkedin.com/feed/hashtag/didAbRyouAbRknowAbRthat/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mrrtsjioqullns8lu8h.png)
Hire ReactJS Developers for Web Development Solutions
Published: 2022-05-06 07:02:04

Hire Dedicated React Developer to build SPAs, multiple architectures, and real-time data exchange applications.Hire ReactJS Developers for to satisfy your business needs. For more info visit https://reactjsdeveloper.com/ 





![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1if43ye7qoitbnqr286d.png)
Switch-cased Error Handling in JavaScript
Tags: discuss, javascript, node, opensource
Published: 2022-05-06 06:55:39

I recently stumbled upon this interesting piece of code from one of Shopify libraries for Node.js. It makes use of an interesting way of error handling with a switch-case statement. 

```js
try {
  // ...
} catch (e) {
  switch (true) {
    case e instanceof Shopify.Errors.InvalidOAuthError:
      res.status(400);
      res.send(e.message);
      break;
    case e instanceof Shopify.Errors.CookieNotFound:
    case e instanceof Shopify.Errors.SessionNotFound:
      // This is likely because the OAuth session cookie expired before the merchant approved the request
      res.redirect(`/auth?shop=${req.query.shop}`);
      break;
    default:
      res.status(500);
      res.send(e.message);
      break;
  }
}
```
[<figcaption>shopify-app-node/server/middleware/auth.js</figcaption>](https://github.com/Shopify/shopify-app-node/blob/main/server/middleware/auth.js#L75-L89)

It's not necessarily shorter than its if-else ladder counterpart and in most cases only makes sense if you're dealing with a library built with various Error classes. Also the performance and readability aspects are up for debate. What do you think?
About me
Tags: introduction, aboutme, profile
Published: 2022-05-13 04:09:48

---
title: About me
published: true
date: 2022-05-06 06:52:19 UTC
tags: introduction, aboutme, profile
canonical_url: https://vietmle.com/posts/about_me/
---

## Who am I?

Hi there 👋 . I am Viet-Minh Le ([@vietmle\_](https://twitter.com/vietmle_)).

- 🎓  Information Engineering & Media ‘22 @ [NTU](https://www.ntu.edu.sg/)
- 💼  Backend Engineer @ [ShopeeSG](https://shopee.sg/)
- 🧑🏻‍💻 Tech stacks: `.py`, `.go`, `.js` , and some more …

## Why I start this blog?

As a non-CS degree person, I find it overwhelmed when self-studying to become a software engineer. I was lucky enough to be guided by my senior, since then my studying process is much easier.

As a result, I start this blog to share my coding journey and hope some of my articles help you in some ways as well.

Moreover, through this blog, I also hope that I can connect with and learn from new like-minded friends like you.

_Follow me ([@vietmle\_](https://twitter.com/vietmle_)) on Twitter to get update whenever my new article is out!_