teleren/devto huggingface dataset:
Nuxt 3 authentication with pinia
Tags: nuxtauth, pinia, nuxt3, nuxt3auth
Published: 2023-03-21 07:53:37

A while ago, l wrote a post on Authenticating a Nuxt 2 application with a Laravel Sanctum API. As much as l like Nuxt.js because of it's cool features like middlewares, plugins, routing, SSR, Nuxt 3 has issues with authentication. Here are some of the reasons:

- Some packages have been removed in Nuxt 3 i.e. nuxt-auth

- No auth scaffolding 

- Default configurations for axios, auth have been depreciated in nuxt.config.ts

To write a good authentication logic in Nuxt 3, you have to come up with your own logic in Store, Middlewares (for routing). 

I tried sidebase package `@sidebase/nuxt-auth` which is a good package but requires more customizations. Later l switched to pinia as documented here: [](https://dev.to/rafaelmagalhaes/authentication-in-nuxt-3-375o)

This method work really well, kudos, but there's a problem again with persistence of state. 

To achive this, install the following package: 

`yarn add -D @pinia-plugin-persistedstate/nuxt` or
`npm i -D @pinia-plugin-persistedstate/nuxt`

Once this is installed at it under your modules array in nuxt.config.js

```
export default defineNuxtConfig({
  modules: [
    '@pinia/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
  ],
})
```

Finally add a persist prop under your defined store like this:

```
// ~/store/auth.ts
import { defineStore } from 'pinia'

export const useStore = defineStore('auth', {
  state: () => {
    return {
      authenticated: 'true',
    }
  },
  persist: true,
})
```

This will automatically instruct pinia to persist any data within it's store attribute. Pinia does this by either using a cookie or local storage, the choice is yours. Reference to this documentation for more global options for pinia persistence. [](https://prazdevs.github.io/pinia-plugin-persistedstate/frameworks/nuxt-3.html)
Syntax Error: What Obstacles Are You Facing As A New Developer?
Tags: discuss, beginners, codenewbie
Published: 2023-03-21 07:00:00

Starting out as a new developer can be rough. There’s so much to learn, and it's easy to feel overwhelmed or discouraged by the amount of information out there. From getting stuck on bugs or errors to just plain old feeling like you don't belong -- it's easy to get down.

But remember, everyone starts somewhere, and we’ve all been there. So, let’s hear from those of you who are new(er) to coding: what challenges are you facing? Is it a struggle with a new language or framework? Understanding algorithms and data structures? Or maybe time management has got you down.

And for those of you who’ve been there, what advice do you have? Share your tips for finding inspiration or overcoming coding obstacles in the comments below.
Scoping for Project 2
Published: 2023-03-21 07:33:34

Here is where we are conceiving the API for the elements involved with completing this homework assignment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7ym9gu1tr3xgz3tbu9y.jpg)

The properties that I think we'll need for completing project 2 are things such as titles, descriptions, and possibly a logo or image for each of the items in the list of things that we will have to post on the web page from our api.

Specific information on things such as the pathing to an image, or the name of one of the specific list elements will need to come from the backend to be able to be displayed on the frontend or running version of the web application that we will create.

A list of information in a .json file will likely be used.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1682m0bd9mfxwddn9zlm.jpg)

A render function to render the specific component that will make the list of items show up on the application will be created in order to format how the properties and elements will be displayed.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8gw8xu7lxecxcxp2bj8.jpg)

We will attack the problem and create a solution by using several of the things that we did in this example homework assignment to be able to successfully deploy the listed information from the api.
Finetuning Chatgpt error
Tags: chatgpt
Published: 2023-03-21 07:24:52

I am facing issues while converting the prompt completion data set into a jsonl file. I am keeping the dataset in a text file and then converting into a jsonl file.

my data set is below:
{"prompt":"Property Usage=Principal Residence, Transaction Type=Purchase, Number of Units=1 Unit", "completion":"The Maximum LTV,CLTV,HCLTV for FRM is 95% and ARM is 95% for property usage Principal residence, transaction type purchase and number of units is one"}
{"prompt":"Property Usage=Principal Residence, Transaction Type=Purchase, Number of Units=2 Unit", "completion":"The Maximum LTV,CLTV,HCLTV for FRM is 85% and ARM is 85% for property usage Principal residence, transaction type purchase and number of units is one"}

When it gets converted into jsonl:
{"prompt":"","completion":"{\"prompt\":\"Property Usage=Principal Residence, Transaction Type=Purchase, Number of Units=1 Unit\", \"completion\":\"The Maximum LTV,CLTV,HCLTV for FRM is 95% and ARM is 95% for property usage Principal residence, transaction type purchase and number of units is one\"}"}
{"prompt":"","completion":"{\"prompt\":\"Property Usage=Principal Residence, Transaction Type=Purchase, Number of Units=2 Unit\", \"completion\":\"The Maximum LTV,CLTV,HCLTV for FRM is 85% and ARM is 85% for property usage Principal residence, transaction type purchase and number of units is one\"}"}

The prompt and completion is not as per the fine tuning model when it gets converted. Kindly help how to do a proper conversion.
What Are Mobile Proxies?
Tags: beginners, mobile, webdev, tutorial
Published: 2023-03-21 07:18:17



There are various types of proxies, and businesses choose them according to their needs. Here, at Oxylabs, we created a video covering everything about **mobile proxies** and why you should consider using them.

**Mobile proxies explained**

In general, proxies are intermediaries between you and the internet. When using a proxy server, your request runs through the proxy server (which changes your IP address) first and only then connects to the website. 

Mobile proxies employ IP addresses only from real mobile devices. Reliable and stable mobile proxies ensure your web scraping project runs smoothly without unexpected errors. With our [Mobile Proxies](https://oxy.yt/ctP2), we offer an automatic IP rotation feature. You can expect fewer CAPTCHAs and IP blocks because our customers can access the required public data from different real mobile IP addresses. 

![mobile proxy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6nqgtkj95scar0dtnbr.png)

**Why do you need mobile proxies?**

When it comes to collecting vast amounts of public data, proxies are necessary to avoid unexpected issues. This video states that reliable mobile proxies (e.g., Oxylabs mobile proxies) will help you access geo-restricted public data because of the extensive list of locations worldwide. 

It's worth mentioning that IP addresses from real mobile devices ensure noticeably fewer IP blocks when collecting public data. Whatever site you try to access will recognize you as a regular user. 

**Things you should know about mobile proxies**

- 
Even if mobile proxies aren't the cheapest proxy solution, it's definitely worth it to use them if CAPTCHAs, IP blocks, and geo-restricted content are issues you encounter constantly. 

- 
In this YouTube video, we distinguish several more benefits to look out for when choosing mobile proxies: high success rates, 24/7 support, easy integration methods & compatibility with third-party apps and tools. 

- 
Mobile proxies are slower compared to other proxy types, e.g., datacenter proxies. However, they have the best IP reputation, meaning blocking them is harder. 

**Conclusion**

In this Youtube video, we talk about mobile proxies as an advanced solution for those wishing to encounter fewer IP blocks and CAPTCHAs when collecting public data. Automatic IP rotation and IP addresses from real mobile devices ensure high success rates for these proxies. 

Even if it's harder to get blocked with mobile proxies, you still have to respect your data sources and collect public data responsibly.
TiDB hackathon 2023 idea
Tags: programming, productivity, serverless, database
Published: 2023-03-21 06:57:18

We are happy to announce that the TiDB hackathon 2023 event is just around the corner, launching this April. We understand that having a creative idea is crucial for participants to join the competition. 
We welcome any interesting application ideas that can be developed using either TiDB Cloud Serverless or TiDB Data API. If you have any ideas, please don't hesitate to submit them.[Could you suggest some interesting application ideas that can be developed using TiDB Cloud Serverle](https://wenjuan.feishu.cn/m/cfm?t=sPSYWcWyQXKi-ksw8)
Lexical Scoping vs Closures
Tags: javascript, react, webdev, programming
Published: 2023-03-21 06:31:59

Lexical scoping and closures are related concepts in programming, but they are not the same thing. Here's a brief explanation of each:

**Lexical scoping**: refers to the way a programming language determines how variables are scoped (i.e., how they are accessible or not) based on their position in the code. In a lexically-scoped language like JavaScript, a variable declared inside a function is only accessible within that function and any nested functions within it. The outer scope, such as the global scope, cannot access those variables.

```
 function outer() {
   let x = 10;
   function inner() {
     console.log(x);
   }
   inner();
 }
 outer(); // Output: 10
```
In this example, we have a function outer that declares a variable x and a nested function inner that logs the value of x to the console. When we call outer, it calls inner, which is able to access the variable x because of lexical scoping. Since x is declared in the outer function, it is accessible to the inner function and can be logged into the console.

**Closures**: A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the **lexical environment**). In other words, a closure "closes over" the variables it needs from its outer scope and maintains a reference to them, even if those variables would otherwise be inaccessible. This can be useful for creating private variables or for preserving state across function calls.

```
 function outer() {
   let x = 10;
   function inner() {
     console.log(x);
   }
   return inner;
 }
 let closureFunc = outer();
 closureFunc(); // Output: 10
```

In this example, we have the same outer and inner functions as before, but this time we're returning the inner function from outer and assigning it to a variable closureFunc. When we call closureFunc, it logs the value of x to the console, just like before. However, the difference here is that inner has access to the variable x even after outer has finished executing, Thanks to the concept of closures. In other words, inner "closes over" the variable x and maintains a reference to it, even though outer has finished executing.

Closures are possible in languages with lexical scoping, but not all languages with lexical scoping have closures. In JavaScript, for example, closures are commonly used to create private variables and functions, and to preserve state in asynchronous code.
How to write clean efficient codes
Published: 2023-03-21 06:30:55

Use proper indentation and spacing to improve readability and maintainability of the code.

Follow a consistent coding style, such as PSR standards, to make it easier for others to understand and contribute to your code.

Use descriptive variable names that accurately convey their purpose and avoid abbreviations or overly short names.

Use comments sparingly but effectively to provide context and explanations for complex or non-obvious code sections.

Use built-in functions and libraries whenever possible, as they have been optimized and tested for performance and security.

Validate all input from users or external sources to prevent SQL injection attacks or other security vulnerabilities.

Keep your functions small and focused on a single task to promote reusability and modularity in your code.
Connect SFTP server using C#
Tags: sftp, csharp
Published: 2023-03-21 06:29:40

SFTP (Secure File Transfer Protocol) is a secure method for transferring files between remote computers. If you're working with an SFTP server and need to access it using C#, there are a few steps you'll need to follow. In this blog post, I'll go through the basic process of connecting to an SFTP server using C# and the SSH.NET library.

## Step 1: Install SSH.NET

Renci.SshNet is an easy to use and common library which can be used to establish connection to SFTP servers. The first step is to install this library using NuGet. You can do this by right-clicking on your project in Visual Studio, selecting "Manage NuGet Packages", and searching for "SSH.NET". Once you find the SSH.NET package, click "Install" to add it to your project.

## Step 2: Establish a Connection

To establish a connection to an SFTP server using C#, you'll need to create an SftpClient object and call the Connect method. Here's an example:

```
using Renci.SshNet;

var host = "your.sftp.host";
var port = 22;
var username = "your.username";
var password = "your.password";

var client = new SftpClient(host, port, username, password);
client.Connect();
```
In this example, we're creating an SftpClient object and passing in the hostname, port, username, and password for the SFTP server. We then call the Connect method to establish a connection.

## Step 3: Transfer Files

Once you've established a connection, you can use the SftpClient object to transfer files between your local computer and the remote SFTP server. Here's an example:

```
var localPath = @"C:\path\to\local\file.txt";
var remotePath = "/path/to/remote/file.txt";

using (var fileStream = new FileStream(localPath, FileMode.Open))
{
    client.UploadFile(fileStream, remotePath);
}
```

In this example, we're uploading a local file to the remote SFTP server. We first create a FileStream object to read the local file, and then call the UploadFile method on the SftpClient object to transfer the file to the remote server.

## Step 4: Disconnect

Once you're done with your SFTP operations, you should call the Disconnect method on the SftpClient object to close the connection. 

```
client.Disconnect();
```

## Conclusion

In this blog post, we've gone through the process of connecting to an SFTP server using C# and the SSH.NET library. We covered the steps of installing the library, establishing a connection, transferring files, and disconnecting from the server. With this knowledge, you should be able to connect to an SFTP server using C# and perform a variety of file transfer operations.
How to integrate APIs & DBs to your low code app
Tags: lowcode, tutorial, database, api
Published: 2023-03-21 06:27:03

If you're building a low-code app, integrating APIs and databases can be an essential part of making your app functional and effective. With APIs, you can connect to other services and platforms, allowing your app to access data and functionality that would otherwise be out of reach. Databases, on the other hand, provide a structured way to store and manage large amounts of data, making it easy to retrieve and manipulate the information your app needs.

So, how do you go about integrating APIs and databases into your low-code app?

So, DronaHQ is hosting a live tutorial that can help you do just that. This tutorial walks you through the process of integrating APIs and databases into your app, giving you the head start you need to create a truly customized solution. With step-by-step instructions and clear explanations, even beginners can follow along and learn how to add APIs and databases to their app.

[Register now and save your spot](https://www.dronahq.com/integrating-apis-dbs-to-your-app-live-dronahq-tutorial/)
Boost Your Next Project with My Comprehensive List of Free APIs – 1000+ and Counting!
Tags: webdev, javascript, react, python
Published: 2023-03-21 05:54:54

If you're a developer or programmer, you know that APIs can be incredibly helpful when it comes to building applications or integrating different systems. But finding the right API can be a daunting task – there are thousands of options out there, and not all of them are free or reliable. That's why I've curated a comprehensive list of over 1000 free APIs to help you with your next project.

Whether you're building a website, mobile app, or desktop application, there's an API out there that can help you achieve your goals. APIs can provide access to data, functionality, and services that can help you save time and resources in your development process.

So, what can you expect from my list of free APIs? Here are just a few examples of the types of APIs that I've curated:

### 10 Sites with API Listings : 👇


**public-api Github Repo** : https://github.com/public-apis/public-apis
**Rapid API** : https://rapidapi.com/collection/list-...
**API House** : https://apihouse.vercel.app/
**Free APIs**: https://free-apis.github.io/#/
**Dev Resources** : https://devresourc.es/tools-and-utili...
**AnyApi**: https://any-api.com/
**Public Apis** : https://public-apis.io/
**API List** : https://apilist.fun/ 
**Public APIs**: https://public-apis.xyz/
**Public API** : https://www.public-apis.ml/

But why use free APIs instead of paid ones? While paid APIs can often provide more robust features and support, free APIs can still be incredibly useful and reliable. Plus, using free APIs can help you save money and resources, especially if you're working on a tight budget.

So, if you're ready to boost your next project with the help of APIs, look no further than my curated list of over 1000 free APIs. With so many options to choose from, you're sure to find the perfect API to take your project to the next level.
Good practice of Managing Front/Back end
Tags: beginners
Published: 2023-03-21 05:52:10

Hello guys i was thinking what is best practice to manage front and back end. 
Forexample i have project name TodoApp so i basically make two folders server and client and make repository at github of TodoApp with both folders in.
But the problem is when i deploy it at Heroku , then i upload server folder to another github repository .

Now i have to manage two repositories first with TodoApp with two folders, and second server 

Please show me the correct method to do it.
Jasa Pembuatan Website Murah & Terbaik
Published: 2023-03-21 05:42:49


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0b6bn12n0y9gq5dp8p6.jpg)
Selamat datang di ESC-ID, sebuah perusahaan kreatif yang fokus pada pembuatan website profesional untuk bisnis dan organisasi. Kami menyediakan solusi website yang sesuai dengan kebutuhan Anda dan dirancang untuk meningkatkan brand awareness, meningkatkan engagement pelanggan, dan meningkatkan konversi.

Visi kami adalah untuk menjadi pemimpin industri dalam pembuatan website yang inovatif dan kreatif, serta memberikan layanan terbaik dan solusi website terbaik untuk pelanggan kami. Untuk mencapai visi tersebut, kami memiliki tim yang terdiri dari ahli web design dan web development yang berpengalaman dan berdedikasi.

Kami menganggap setiap klien sebagai mitra kami, dan kami berusaha untuk memahami bisnis Anda dan tujuan Anda dengan baik sehingga kami dapat memberikan solusi website yang paling tepat untuk Anda. Kami menggunakan pendekatan yang terstruktur dan teruji untuk memastikan setiap proyek kami dilakukan dengan efisien, tepat waktu, dan sesuai dengan standar kualitas yang tinggi.

Layanan yang kami tawarkan meliputi pembuatan website responsif, website e-commerce, website perusahaan, website pemerintah, website personal, website media sosial, dan masih banyak lagi. Kami juga menawarkan layanan dukungan website, termasuk pemeliharaan website, hosting website, dan pembaruan website.

Kami memiliki komitmen untuk memberikan layanan yang berkualitas tinggi, tepat waktu, dan terjangkau. Kami bangga menjadi partner bisnis Anda dalam mengembangkan bisnis dan mencapai tujuan Anda melalui website. Jangan ragu untuk menghubungi kami untuk diskusi lebih lanjut tentang solusi website terbaik untuk bisnis Anda.

Terima kasih telah memilih ESC-ID sebagai mitra website Anda.

Info Lebih Lanjut:
Website : [esc-id.com](https://esc-id.com)
Whatsapp : [6285786180299](https://wa.me/6285786180299)
Efficient and Secure Multi-Platform Device Management with Suma Soft's Support Services
Tags: multiplatformsupport
Published: 2023-03-21 05:15:42

Looking for a secure, efficient, and flexible solution to manage your organization's devices and end-users across different platforms and network segments? Suma Soft's Multi-Platform Support Services offer a centralized management solution with customizable security credentials, multi-factor authentication, and cross-platform support for Windows, Mac, Linux, and Android. Here are some benefits and features of our services:
Benefits:
Efficient management and reduced operating time
Flexibility to work with devices and systems you already use
Secure and reliable remote access
Features:
Gateway connections across network segments
Customizable security credentials and multi-factor authentication
Cross-platform support for Windows, Mac, Linux, and Android
Support for embedded operating systems
Centralized management of individual and group roles & permissions
Contact us today and simplify your endpoint management!
Phone:+1 302-303-9525
Email: sales@sumasoft.com
Website :https://www.sumasoft.com/digital/multi-platform-support-services/
Transform Your Business with Suma Soft's Cloud Migration Services: Simplify Your Infrastructure, Improve Security
Tags: cloudmigration
Published: 2023-03-21 04:59:27

In the era of digital transformation, cloud computing has become an essential part of businesses. Suma Soft, a software development company, offers cloud migration services and solutions to help organizations achieve their digital goals. Here are some highlights:
Benefits of Cloud Migration: The cloud offers improved security, scalability, reduced cost, and faster time-to-market, making it a suitable solution for businesses. Suma Soft's engineers work closely with decision-makers to identify the right approach for their organization.
Types of Cloud Migration: Suma Soft offers various cloud migration services, including cloud application, infrastructure, database, platform, AWS, and Azure migration. Infrastructure optimization and on-premise to cloud migration services are also available.
By choosing Suma Soft's cloud migration services, businesses can simplify their infrastructure, accelerate development, improve data security, and optimize cost. The company provides expert guidance in selecting the most optimal package of cloud services and tools and ensuring a smooth transition to the cloud platform.
Contact One of Our Agents!
Phone: +1 302-303-9525
Email: sales@sumasoft.com
Website :https://www.sumasoft.com/digital/cloud-migration-services/
Reliable Cloud Testing Solutions for Data Protection - Suma Soft
Tags: cloudtesting
Published: 2023-03-21 04:58:20

Suma Soft offers on-demand, low-cost, and robust cloud testing solutions to ensure reliable data protection. Our cloud testing services encompass functional and non-functional approaches, making applications/software scalable, flexible, and secure. Our engineers have profound experience building high-grade customized Quality Assurance and testing solutions that improve the quality of the application without the high cost. With Suma Soft’s Cloud Testing Services, enterprises can cut time-to-market and avoid up-front costs when deploying new software and applications. 

Contact us today to schedule a consultation and learn more about how Suma Soft's Cloud Testing Services can help your organization improve its cloud infrastructure and ensure a positive customer experience.

Phone: +1 302-303-9525
Email: sales@sumasoft.com
Website : https://www.sumasoft.com/digital/cloud-app-testing-services/