teleren/devto huggingface dataset:
How to Get PostgreSQL Explain / Analyze Statistics from the Supabase Javascript Client
Published: 2023-02-03 18:09:27

## Please Explain
PostgreSQL has this great tool for analyzing complex queries.  You can use it to see what parts of your query are "costing" you CPU time, and use that information to build the right indexes to make your queries run lightning fast:

Postgres `EXPLAIN` — show the execution plan of a statement

[https://www.postgresql.org/docs/current/sql-explain.html](https://www.postgresql.org/docs/current/sql-explain.html)

This is great when you're writing SQL, but what if you're using the Supabase Javascript client?

```js
const { data, error } = await supabase
  .from('users')
  .select(`
    name,
    teams (
      name
    )
  `)
```

Maybe you tried using `select query from pg_stat_statements` to find the query that your client code is sending to PostgreSQL.  But then you see all sorts of parameters in the query such as `$1`, `$2`, `$3`.  Now how do you analyze this?

There's an easier way -- you can get this data right from your client in debug mode.

## Step One: Turn on `db_plan_enabled`
To be able to debug from the client side, you'll need to enable it first by running these commands:

```sql
alter role authenticator 
set pgrst.db_plan_enabled to true;
notify pgrst, 'reload config';
```

## Step Two: Debug your client queries
Now that you have `db_plan_enabled` turned on you can do this in your client code:

```js
const { data, error } = await supabase
  .from('users')
  .select(`
    name,
    teams (
      name
    )
  `)
  .explain({
      analyze: true, 
      verbose: true, 
      format: 'json'})
```

This will return valuable information about the query execution plan that you can use to tune your database for better performance.

## Step Three: Turn it off
When you're done debugging, just turn `db_plan_enabled` back off with:

```sql
alter role authenticator 
set pgrst.db_plan_enabled to false;
notify pgrst, 'reload config';
```

## Conclusion
This makes it easier to see exactly what PostgREST (the PostgreSQL REST interface used by the Supabase Javascript library) is doing behind the scenes.  Once you know where the big costs are in your query, you can build the necessary indexes and you should see better performance on those operations.

## Note
You'll need to be on PostgREST 10.1.1 or higher to get this capability.  

To check your version, you can run this:

```sh
curl '<SUPABASE_URL>/rest/v1/' \
-H "apikey: <SUPABASE_ANON_KEY>" \
-H "Authorization: Bearer <SUPABASE_ANON_KEY>" | more
```

You'll see the PostgREST version near the very beginning of the output.
Residential VPN: An Introduction
Published: 2023-02-03 17:54:03

[Residential VPN ](https://coronium.io/residential-vpn/) is a game changer when it comes to online privacy and security. With a mobile residential VPN, you can enjoy a private, secure, and fast internet connection on the go. In this article, we will be discussing the 5 use cases of **Residential VPNs** and why they are more convenient than regular VPNs.

**Unrestricted Online Access**
With a Mobile VPN, you can access any website or online service from anywhere in the world. Whether you are travelling, or just trying to access content that is restricted in your country, a Mobile VPN will allow you to bypass geo-restrictions and enjoy unrestricted online access.

**Increased Online Privacy**
Mobile VPNs protect your online activities from prying eyes, including hackers, government agencies and even your own Internet Service Provider (ISP). With a Mobile VPN, your online data is encrypted, and your online identity is hidden, ensuring that your online activities remain private and secure.

**Safe Online Transactions**
With a Mobile VPN, you can safely and securely complete online transactions, such as online shopping and banking. With a secure VPN connection, you can have peace of mind knowing that your financial information and personal data is protected.

**Secure Public Wi-Fi Connection**
Mobile VPNs provide an extra layer of security when using public Wi-Fi networks. Public Wi-Fi networks are often unsecured and can leave your personal data vulnerable to hacking. With a Mobile VPN, your online data is encrypted, making it impossible for hackers to access it.

**Avoiding Captchas and Verifications**
Mobile VPNs offer clean IP addresses, which are not dirty like regular VPN IP addresses. With a clean IP address, you will not have to deal with hundreds of captchas and verifications, making your online experience much more seamless and convenient.

If you're looking for great residential VPN (it comes from mobile devices with SIM cards in it) [coronium.io proxy marketplace](https://coronium.io/) got you covered - all our proxies come with OpenVPN configs and will allow you to easily configure your residential VPN.

In conclusion, **Residential VPNs** are the way to go for anyone who values online privacy, security and convenience. With a Mobile VPN, you can enjoy unrestricted online access, increased privacy, safe online transactions, secure public Wi-Fi connections, and avoid captchas and verifications. To enjoy the benefits of a Mobile VPN, simply download the OpenVPN app, and you can quickly proxify your whole device, without the hassle of IP:PORT:USERNAME:PASSWORD or other complex integrations.
New account registration
Tags: transfer, ussd
Published: 2023-02-03 17:51:49


[https://www.bankfanz.com/globus-bank-transfer-code/](https://www.bankfanz.com/globus-bank-transfer-code/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)

https://plaza.rakuten.co.jp/globusbankussd/diary/202302030000/
https://www.divephotoguide.com/user/globusbankussd12
https://www.producthunt.com/@globus_transfer
https://www.provenexpert.com/globusbankussdcode12/
https://vocal.media/authors/globus-bank-ussd-code-12
https://wakelet.com/@globusbankussdcode12204
https://www.lifeofpix.com/photographers/globus_bank_ussd_code12/
https://rosalind.info/users/globus_bank_ussd_code12/
http://phillipsservices.net/UserProfile/tabid/43/userId/197242/Default.aspx
https://camp-fire.jp/profile/globus_bank_ussd_code12
https://app.roll20.net/users/11586370/globus-bank-ussd-code-12-k
https://seedandspark.com/user/globus-bank-ussd-code12
https://plazapublica.cdmx.gob.mx/profiles/globus_bank_ussd12/activity
https://peatix.com/user/15798070/view
https://www.metal-archives.com/users/globus_bank_ussd_code12
https://trabajo.merca20.com/author/globus_bank_ussd_code12/
https://www.intensedebate.com/people/Globus_bank12
https://www.mifare.net/support/forum/users/globus_bank_ussd_code12
https://pinshape.com/users/2566898-globus-bank-ussd-code12#designs-tab-open
https://www.kiva.org/lender/globusbankussdcode126461
https://www.credly.com/users/globus-bank-ussd-code-12/badges
https://www.myminifactory.com/users/Globusbankussdcode12
https://www.sqlservercentral.com/forums/user/globus_bank_ussd_code12
https://guides.co/a/globus-bank-u-6671
http://foxsheets.com/UserProfile/tabid/57/userId/119788/Default.aspx
https://storium.com/user/globus_bank_ussd_code12
https://speakerdeck.com/globus_bank_ussd_code12
https://www.longisland.com/profile/globus_bank_ussd_code12
https://myanimelist.net/profile/globus_bank12
https://social.msdn.microsoft.com/Profile/globus_bank_ussd_code12
https://www.iheart.com/podcast/269-globus-bank-ussd-code-12-108280670/episode/globus-bank-ussd-code-12-108280671/
Things to know as a Beginner in JSON.
Published: 2023-02-03 17:27:17



##Things to remember...

1. JSON stands for JavaScript Object Notation.

2. JSON is very lightweight as compared to XML.

3. It is text format for storing and retrieving data.

4. It is human readable and easy to understand.

5. It is very good to use JSON rather than XML.

6. With JSON, can easily integrate with JavaScript.

7. The file type for JSON files is ".json"

---

example of JSON...

```
'{"name":"Tae", "age":26, "bike":null, "isGood" : true}'
```

in the above example, we can see that JSON is like an object that has key-value pairs. you have to enclose the JSON object with backticks(``).

It can take  values as numbers, strings, null, Boolean, array and object.
You can also store an array in array, object in arrays as long as it is readable.

````````
newJson = '{"name":"Tae", "age":26, "bike":null, "isGood" : true}'

//'{"name":"Tae", "age":26, "bike":null, "isGood" : true}'

parsedJson = JSON.parse(newJson)

// {name: 'Tae', age: 26, bike: null, isGood: true}

parsedJson['age']

//26

parsedJson["isGood"]

//true
````````

Store json object in new variable named newJson.

parse the jSON object so that you will get the JavaScript object and can access JavaScript object.
Books that teach me how to code.
Tags: books, webdev, html, css
Published: 2023-02-03 17:25:01

I'm writing this for absolute beginners starting on learning how to code. These are some books that helped me stay consistent in learning how to code. One of the books is not a programming book but it helped me immensely in my journey. Some find it hard to learn with video tutorials, or hard to stay motivated, if you're that person then try these books out. 

## 1. Atomic Habits by James Clear
![Atomic Habits by James Clear](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmtz4ol37tbb8sy5e1uh.jpg)
<p>This book is not a programming book, but this book is the most life-changing book for me. I think anyone finding it hard to stay motivated and consistent should read this book.  I recommend this book as It's not easy to stay motivated learning how to code. With this book I was able to stay consistent in learning to code, the idea is that you can program yourself to repeat the same habits again and again to notice incremental improvements over the long term. To change your life in programming with your results, you should do gradual growth continuously(coding and learning together) daily to build a habit.</p>

## 2. HTML and CSS by Jon Duckett

![HTML AND CSS by Jon duckett](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fwrdy0gof79r9263mey.jpg)
<p>This book is my foundation. This book teaches you HTML and CSS more nicely and simply. The book is written and presented to make it easy for beginners. Trust me It's one of the best books you'll find on your journey to learning HTML and CSS. I haven't seen a better book than this one that teaches HTML and CSS without boring a reader. I was able to learn HTML and CSS in a short time. </p>

<p>Hope you find the guide helpful, feel free to like and follow me. I would like to thank you for reading it till the end. Also, I would appreciate it if you could share your views and comment on them below.</p>.

Let's connect on any of my socials
<a href = "https://twitter.com/tanimu_maidoki">Twitter</a>
<a href = "https://www.instagram.com/umarmaidoki._/">Instagram</a>
<a href = "https://github.com/Gentlemanintech">Github</a>
How to get YouTube thumbnail fast?
Tags: youtube, thumbnail, downloader, shorts
Published: 2023-02-03 17:21:32

You can get a YouTube thumbnail quickly by following these steps:

**Method I**
1. Find the YouTube video you want the thumbnail from.
2. Look at the URL of the video and replace "watch?v=" with "v/".
3. Add "maxresdefault.jpg" to the end of the URL.
4. Open the URL in your browser to view the full-size thumbnail.
5. Right-click on the thumbnail and select "Save Image As" to download it.

**Example:**

For a YouTube video with the URL "youtube.com/watch?v=dQw4w9WgXcQ", the URL for the full-size thumbnail would be "i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg".

**Methods II**

There are several websites that allow you to download YouTube thumbnails, some of them are:

YoutubeThumbnailDownloaderOnline - https://www.youtubethumbnaildownloaderonline.com

![YouTube thumbnail downloader online hd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eje44mcbl4uynsifb8sm.png)

Note: It is important to respect copyright laws and the terms of service of YouTube and the websites you use to download thumbnails.
Lesson Learned From Code Review
Tags: starchart, senecaosd700, opensource, typescript
Published: 2023-02-03 16:46:26

I had rounds of code reviews for my PR to add Route53 DNS module to `Starchart`. Here's what I learned from the code review. 


### Working code is not enough, it should be easily readable for other developers
I wrote a `createRecord` function that creates a record in Route53 hosted zone. At the beginning, it didn't have `hostedZoneId` as I was thinking we would use only one hosted zone and I could treat it as an environment variable. Then I needed ability to set a hosted zone for testing purpose and added `hostedZoneId` to the function as the last parameter. But this is not a good practice. Some people would think `hostedZoneId` is something that exists inside a record. It works same if I add `hostedZoneId` in any order in the function, but the code should look clearer for others to understand. 


### Don't let same logic duplicated on the code
Even though I know this rule and try not to write same logic in different functions, but it occurs when I don't look at my working code closely again. Duplicate code can be reduced by reviewing and refactoring multiple times before pushing it to repo. Again working code is not enough. Repeating code will result in bugs once someone fails to modify all of the same logic. Good refactoring skills come after a lot of practices. Once you confirm that the code is working, it's time to find places to improve. 


### Function should do only one thing whenever possible
This is a good principle to write good tests or write tests more easily. Also it's good to produce the right error message when something breaks. Function name should be as clear as possible. `validate()` does not give any clue what to validate. If it can be broken down to `validateRecord()` and `validateDomain()`, it will be much easier to read and probably people don't have to look into function implementation. 


### Don't use unnecessary syntax and use `linter` to set a rule to maintain consistency
Which code looks cleaner and easier to read? 

```js
function foo() {
    if (x) {
        return y;
    } else {
        return z;
    }
}
```
```js
function foo() {
    if (x) {
        return y;
    }
    return z;
}
```

Both work same, but we don't want to write unnecessary statement. We can avoid unnecessary syntax or error-prone code by using `linter`. It will help you get used to certain principles. 


### Conclusion
You will look much more professional if you look through your code and improve before someone reviews. Also thoroughly take reviewer's comments and discuss if you have a different opinion. Opinions are always debatable. You will learn more from discussion.
3 Clear Reasons Why You Should Invest in a Website for Your Business
Published: 2023-02-03 16:38:16

Having a website for your business is essential in the modern age. Here we provide 3 clear reasons why you should invest in one for your business. 

It serves as an online platform to establish credibility, generate marketing opportunities, and facilitate communication with customers. 

A website can showcase the brand, portfolio, services, and products and allow potential customers to access information about the business anytime and anywhere. It also serves as a powerful marketing tool that can be optimized for SEO, content marketing, social media, and influencer marketing. Additionally.

A website enables easy communication with customers, who can fill out contact forms, make inquiries, and even make purchases directly from the site. A website is an invaluable asset that can bolster the brand's recognition, increase customer satisfaction, and lead to repeat business.

[Reason 1: Establish Credibility
Reason 2: Generate Marketing Opportunities
Reason 3: Facilitate Communication with Customers](https://thynkstudio.com/why-business-need-website/)


[Read More](https://thynkstudio.com/why-business-need-website/)
What was your win this week?
Tags: discuss, weeklyretro
Published: 2023-02-03 16:24:29

Hey folks! 👋

Hope y'all all enjoy your weekends.

Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Getting some new shoes 👟

---

![Dorothy from The Wizard of Oz clicking her heels in the red ruby slippers.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bstgt56dr1n6gwlkhzv1.gif)
Create 10 AWS EC2 with Terraform แบบเร็วๆ
Published: 2023-02-03 16:05:51

จะมีงานหนึ่งที่ผู้ดูแล Infrastructure จะต้องทำบ่อยๆ ก็คือการสร้าง Virtual Machines ตามที่เพื่อนร่วมงาน, แผนกอื่น, คู่ค้า, ลูกค้า ฯลฯ ต้องการ

สวัสดีครับ วันนี้เราสามารถเร่งเวลาของงานที่ทำบ่อยๆ ได้ด้วย Terraform
โดยเริ่มจาก Ubuntu 22.04 เครื่องปล่าจนถึงได้ 10 AWS EC2

## ติดตั้ง Terraform
Prerequisites
`sudo apt-get update && sudo apt-get install -y gnupg software-properties-common`


Download the Singing Key
`wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg`


Verify the Singing Key
798A EC65 4E5C 1542 8C8E 42EE AA16 FCBC A621 E701
`gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint`


เพิ่ม Repositories
`echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list`


Update
`sudo apt update`


Install
`sudo apt install terraform`


ตรวจเช็คว่า Terraform พร้อมใช้งานแล้ว
`terraform -help`



## สร้าง EC2
สร้าง Directory
`mkdir iac-aws
cd iac-aws`


สร้างไฟล์ main.tf
ใส่ aws access_key และ aws secret_key ของเราครับ
```
provider "aws" {
  access_key = ""
  secret_key = ""
  region     = "ap-southeast-1"
}

resource "aws_instance" "iac-aws" {
  ami           = "ami-0af2f764c580cc1f9"
  instance_type = "t2.micro"
  tags = {
    Name    = "aws-vm"
  }
}
```


ทำการ init
`terraform init`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uu67ap0e77g8ogj7z95e.jpg)


เตรียม Plan การสร้าง
`terraform plan`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19eq1esiwdbcpdhg0gcb.jpg)


สร้างเครื่องจริง
พิมพ์ yes เพื่อยืนยัน
`terraform apply`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9lpqym02cexc9r9ze68.jpg)


ถ้าต้องการ 10 เครื่อง ให้เพิ่ม count
```
resource "aws_instance" "iac-aws" {
  count = 10
...
```


ให้แต่ละเครื่องมีเลขกำกับ
```
...
  tags = {
    Name    = "aws-vm-${count.index}"
  }
...
```


เตรียม plan และ apply อีกครั้ง
`terraform plan`
`terraform apply`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7dhronls8jgczk72cksv.jpg)


เมื่อใช้งานเสร็จ สามารถสั่งลบได้ทีละ 10 เครื่องเช่นกันครับ โดยไม่กังวลว่าจะลบผิด
`terraform destroy`


หากต้องการ VM เพิ่ม ขอแยกเป็น 2 เคสครับ

- เพิ่มจาก 10 เป็น 11 VMs ให้แก้ไข count=11 จากนั้นรันคำสั่ง terraform plan; terraform apply จะได้ VM เพิ่ม 1 เครื่องโดยไม่กระทบ 10 VMs ที่มีอยู่
- หากต้องการสร้าง VM ชุดใหม่ โดยแยกจากชุดแรก ให้สร้าง Directory และ main.tf ใหม่

ในตอนหน้า พบกับ Cloud Providers เจ้าอื่นๆ และจะต่อยอดไปที่การทำ Multi-Cloud ครับ

Reference: https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
Zeroing in on Security: The Concept of Zero-Knowledge Proofs
Tags: blockchain, security, web3
Published: 2023-02-03 16:03:47

Zero-knowledge proofs are the real deal, they keep information under wraps like a magician’s cape. Making sure everything is hidden, but still verifiable, just like a rabbit in a hat.

It is used in things like online transactions and voting to keep information private and secure. It’s a secret handshake that only you and the person you’re talking to know, and this helps protect your personal information, your money, and/or your assets.

Imagine you’re at a flea market and you want to buy a rare vintage record. You want to make sure the seller is telling the truth about its authenticity, but you don’t want them to know exactly how much you’re willing to pay for it. With a zero-knowledge proof, the seller can prove that the record is authentic without revealing its exact value. It’s like playing a game of 20 questions, where the seller answers “yes” or “no” to your questions about the record, and you eventually figure out if it’s the real deal or not and without the seller ever revealing the exact value or any additional information.

Zero-knowledge proofs are used in secure online transactions, such as in cryptocurrency, to keep sensitive information, such as financial details, private. They are also used in privacy-focused cryptocurrencies like Zcash, which uses Zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) to verify transactions without revealing any information about the sender, receiver, or transaction amount.

Another example of zero-knowledge proofs in use is in privacy-preserving smart contracts. These allow for the automated execution of a contract’s terms while still keeping sensitive information private. For example, a zero-knowledge proof could be used to verify a loan application without revealing the applicant’s personal information.

In the digital age, privacy and security are of utmost importance and Zero-knowledge proofs helps ensure that only the necessary parties have access to sensitive information. After many years of change and updates, I believe it is finally starting to be used as much as it could/should be and we are becoming much more aware to privacy and security!
CodePen Designs - 32 : Space globe - Three.js
Tags: codepen, css, design, webdev
Published: 2023-02-03 15:51:42

### We are excited to introduce our new series that will explore the best design ideas from the Codepen community. 

We will be publishing these each day and hope you find them insightful and inspiring as we showcase some of the most talented designers in this space.

---


#### Codepen Design - 32
<p>Three.js is hard to learn but I am trying</p>

<p>Photo: NASA Images &amp; freepic.com</p>

{% codepen https://codepen.io/isladjan/pen/bGpjZwN %}



---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)


---
---