teleren/devto huggingface dataset:
Implementing Features like Docusaurus
Tags: javascript, opensource
Published: 2023-11-02 16:01:53

I'm excited to share a cool update on the text-to-HTML converter tool I've been working on. Picture this: You've got a bunch of raw text and markdown files, and you want to showcase them on the web in a sleek, organized way. That's where my converter comes in handy, turning plain content into dazzling HTML pages effortlessly.

So, what's new? Inspired by the brilliance of Docusaurus, I decided to level up my tool with some fantastic features. Docusaurus is fantastic for creating documentation websites, and I thought, "Why not borrow some of that awesomeness?"

Now, the converter not only transforms your files into stylish HTML but also adds some flair. Say hello to the brand new sidebar and index page features! This means your content isn't just functional; it's also beautifully organized, inspired by the elegance of Docusaurus.

But, like any journey, this one had its bumps. Recently, I ran into an issue when trying to run the tool. The infamous "Cannot find module" error threw me off. After some detective work, I discovered that the CLI file wasn't in the expected location. A quick fix, and everything was back on track.

As for what's next, I'm super pumped to expand customization options, handle errors more gracefully, and support an even wider array of file types. The journey continues to add some more feature to this tool.

Stay tuned for more updates, and let's make this converter the go-to tool for transforming text into stunning web content.

Happy coding! 🚀
When to rate-limit your endpoint?
Tags: api, webdev, beginners, learning
Published: 2023-11-02 16:00:19

Rate limiting is used in the API mainly for,

**Protecting resources**: 
Prevent server overload by limiting the number of requests a user can make in a given time frame.

**Maintaining stability of the API**: 
Ensure consistent API performance, even during traffic spikes or attacks.

**Controlling costs**: 
Manage expenses related to data transfer and usage-based pricing.

**Ensuring security**: 
Defend against malicious activities like brute-force attacks or credential stuffing.

**Providing fair access for users**: 
Guarantee equal access to API resources for all users or applications.

You can read more about other [API best practices in my visual eBook](https://www.learnwithparam.com/resources/ebooks) 🚀.
109 berufliches Vorwärtskommen: Das Streben nach Mehr und Mehr.
Tags: deutsch, career, motivation, discuss
Published: 2023-11-02 16:00:00

Moin Moin,

wir IT-Fachkräfte streben nach Mehr und Mehr (1). Dies sieht man an unserem ständigen Fortbilden. 
Anmerkung: _dev.to ist in gewisser Maßen ein Plattform auf der IT-Fachkräfte, insbesondere Software-Entwickler, >Fachbeiträge< schreiben bzw. lesen._

Dies wiederum liegt zum Teil daran, dass die IT einem ständigen Wandel unterliegt. Ob dies neue Forschungsergebnisse sind bzw. ein neuer Stand der Technik ist, neue Kundenwünsche und weiteres. All dies muss erlernt werden und vieles davon muss förderlich für Unternehmensziele angewendet werden.

Wenn wir uns uns also ständig fortbilden, stellen sich die Fragen:

1) Ob sich dies in unseren Gehältern widerspiegelt, bzw. ob dies unter anderem [die Schere der Gehaltsvorstellungen→](https://dev.to/amustafa16421/89-berufliches-vorwartskommen-die-schere-der-gehaltsvorstellungen-3p9n) beeinflusst. 

2) Ist ein herkömmliches Festgehalt, welches ab und zu ( minimal ) erhöht wird, ein geeignetes Vergütungsmodell für uns?

3) Gibt es ggf. eine mangelnde Lernbereitschaft bei einigen von uns, die, über die Zeit, zu einem Fachkräftemangel führt?

Was denkst du dazu?

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch

(1) Manche Streben nach Meer und Mär :-)

{%  embed https://dev.to/amustafa16421/89-berufliches-vorwartskommen-die-schere-der-gehaltsvorstellungen-3p9n %}
Nuxt Social Share module has been released 🎉
Tags: nuxt, vue, javascript, frontend
Published: 2023-11-02 15:56:04

In some of my most recent Nuxt projects I have been in need of implementing some simple social sharing buttons, like those that you often find at the bottom of blog posts, to help users share your content across various social media and messaging applications: 


![Nuxt Social Share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7zhjdouysblbychqi26.png)



Even if the process itself is quite simple (it just involves providing your current page URL as a parameter to another end-point URL specific to a given social network), it is repetitive and does not require complex configuration, so it is best managed with a dedicated component, and maybe from a module so it could be used in many projects, not just once.

After realizing that such a module did not exist yet in the official [modules directory](https://nuxt.com/modules), I decided to write a little module myself and release it as open-source.

The module can be installed in your project with:

```bash
# pnpm
pnpm add -D @stefanobartoletti/nuxt-social-share
# yarn
yarn add --dev @stefanobartoletti/nuxt-social-share
# npm
npm install --save-dev @stefanobartoletti/nuxt-social-share
```
And by adding it to your `nuxt.config.ts`:

```js
export default defineNuxtConfig({
  modules: [
    '@stefanobartoletti/nuxt-social-share'
  ],
  // optional configuration
  socialShare: {
    // module options
  }
})
```

It will then provide a simple component that you can include wherever you need in your templates:

```vue
<SocialShare network="facebook" />
<SocialShare network="twitter" />
<SocialShare network="linkdin" />
```

That's it! A more detailed documentation is available in the official repository hr -> https://github.com/stefanobartoletti/nuxt-social-share

This module is fully functional but it is an early release, more features and other networks will be available in future roles. Any kind of feedback and contribution is kindly welcome 💚

Happy coding (and sharing) 🎉
In Defense of Having All Code in a Single File.
Published: 2023-11-02 15:51:15

I recently wanted to split of a series of scripts I made for a postgres project I was working on into its own cli tool. I started by outlining the tool, I wanted a `pgrun bundle`, and a `pgrun test` command. This is what I had after a little bit of development:

```
.
├── README.md
├── args.ts
├── bundle.ts
├── cli.ts
├── context.ts
├── main.ts
├── options.ts
├── organizer.ts
├── organizer2.ts
├── parse.ts
├── run.sh
├── shake.ts
├── sort.ts
├── sort2.ts
├── sql.ts
└── walk.ts
```

I had a whole bunch of functions spit into their own files, and it started to be a headache to maintain. I felt every time I made some new thing, I'd isolate it in it's own file. I've [vented about files and folders in the past](https://dev.to/reggi/vscode-deno-notebook-48kp), as well as invented [whole new ways to organize typescript projects](https://dev.to/reggi/i-invented-a-cli-tool-to-organize-my-typescript-projects-1j82).

But nothing is as simple as this:

```
.
├── README.md
├── bin.ts
├── deno.lock
├── mod.ts
├── test.ts
└── types.ts
```

What's the shift? Simply having all the functions in [one mod.ts file](https://github.com/reggi/pgrun/blob/main/mod.ts), it's still under 500 lines. It became a shift slightly but utilizing search and replace within the same file became much easier than digging around the files for the function, and having to deal with import / exports.

This is a gentle reminder to myself to not break things out early on, and keep it simple, keep it all contained in one file if you can, it makes it so much easier to manage.
Introduction to Playwright
Tags: playwright, e2e, testing, vscode
Published: 2023-11-02 15:49:22

Hi everyone, in this series, I’m going to tell you about [Playwright](https://playwright.dev/), an open source end to end testing Framework by Microsoft for testing your modern web applications. Playwright supports all modern browsers and works on all platforms.
 
Playwright can automate what a user does such as clicking on elements, filling in text etc. As Playwright is like a fast user it waits for elements to be actionable before it clicks on the them, and retries when making assertions to ensure your tests are not flaky. And as tests run in parallel by default test execution is really fast.
 
Playwright comes with a great developer experience thanks to tooling such as [Codegen](https://playwright.dev/docs/codegen), [trace viewer](https://playwright.dev/docs/trace-viewer) and the [VS Code extension](https://playwright.dev/docs/getting-started-vscode).
 
In the next post let’s take a look at how to install Playwright.

## Check out the video

{% embed https://youtu.be/4-LwodVujTg %}

## Useful Links

- [Playwright docs](https://playwright.dev/docs/getting-started-vscode)
- Join our [Discord server](https://aka.ms/playwright/discord)
- Subscribe to the [Playwright YouTube channel](https://www.youtube.com/@Playwrightdev)
From Basic to Custom: AI Chatbot Building 101
Tags: tutorial, ai, beginners, python
Published: 2023-11-02 15:47:19

## AI Custom Chatbot Quickstart

**To get started leveling up your custom AI chatbot, check out our [GitHub repository here](https://github.com/focused-labs/ai-custom-chatbot-quickstart).**

Domain specific AI chatbots are powerful applications that can be used in many use cases: 

- Virtual Assistants
- Knowledge retrieval
- Text synthesis
- Text formatting
- Sentiment analysis

## Building AI chatbot apps is easy. Customizing is hard.

This ready-to-go sample project shows you how to build a custom chatbot using our preferred LLM tech stack:

- [OpenAI](https://openai.com/)
- [Langchain](https://python.langchain.com/docs/get_started/introduction)
- [Llama Hub Data Loaders](https://llamahub.ai/)
- [Pinecone Vector Database](https://pinecone.io/)
- Python [(FastAPI web framework)](https://fastapi.tiangolo.com/)

We are leveraging Retrieval Augmented Generation (RAG). 

### The goal of this tutorial is to demonstrate the basics.

- Demonstrate how to add custom data to an LLM model (we're using OpenAI's gpt-3.5-turbo)
- Demonstrate a conversational memory LLM chatbot
- Demonstrate using agents and tools with the Langchain Framework

### Technical Objectives

- Ingest data into a vector database
- Query the vector database
- Query an agent that decides whether to query the vector database

### Here’s a peak at the components of a basic AI custom chatbot.

![Architecture Overview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1rsq1j3wfp9p12j5m19.png)

#### For more resources: check out [our other blog posts on AI](https://focusedlabs.io/ai).
Data Structures & Algorithms using Java
Tags: freecodez, react, html, blog
Published: 2023-11-02 15:38:22

Hey there, You are most welcome to this article. I hope you will enjoy this article. If you like this article then please share this article with your friends and colleagues. If you have any questions or suggestions regarding this article then please comment down below.

**Data Structures & Algorithms using Java**

![Data Structures & Algorithms using Java](https://res.cloudinary.com/freecodez/image/upload/v1694870097/images/ymaxbue7brnrpr2gzpb6.webp)

For full source code visit : [https://freecodez.com/post/ry746t1](https://freecodez.com/post/ry746t1)


```

```

Source Code : [https://freecodez.com/post/ry746t1](https://freecodez.com/post/ry746t1)

For more such articles visit : [https://freecodez.com](https://freecodez.com/all)
The Book for Basement Inhabitants
Tags: programming, learning, programmers, productivity
Published: 2023-11-02 15:37:59

If you are a programmer or anyone who lives in the basement and wants to ruin your life, then you must read this book.

Few days ago, I read an eBook which I never wanted to get. It is called **How to Die Alone**. The book has more pictures than it has paragraphs and would take ≤27 min to read, even slowly.

It focuses on a MC who will help you make your life just like her. The main the MC would take you from being a piece of crap in your bed to destroying your friendships and also how to rig your office life.

## Where to Get?
If you have money and time to buy the book, then you can get it from [Here](https://www.amazon.com/How-Die-Alone-Foolproof-Yourself/dp/1523504269).
But if you don't, like me, then you can download it [Here](https://oceanofpdf.com/authors/mo-welch/pdf-epub-how-to-die-alone-the-foolproof-guide-to-not-helping-yourself-download-86820122150/?id=000668411983).

## Conclusion
I read the book and from what I read, I can tell you that it really helps you focus on your life (kind of) and not get bored like other books. 
So Good Luck being more miserable!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y30v9vdieg4yaxmr4ona.gif)
Debug JS events with monitorEvents
Tags: javascript, debugging, console
Published: 2023-11-02 15:35:04

It can be challenging sometimes to debug events, because of how many browsers and devices there are, so I wanted to share one underrated feature called `monitorEvents` that can track events on specific elements in the document.

## Log all events firing on the body element
```
monitorEvents(document.body)
```

## Log all mouse events on the body
```
monitorEvents(document.body, 'mouse')
```

## Log all events on all input elements
```
monitorEvents(document.body.querySelectorAll('input'))
```
C# - Asynchronous Programming with Cancellation Tokens
Tags: csharp, programming, tutorial, beginners
Published: 2023-11-02 15:30:00

Cancellation tokens provide a way to gracefully cancel asynchronous operations. They are useful when you want to allow users to cancel long-running tasks or when you need to terminate asynchronous operations in response to certain conditions.

Here's an example that demonstrates how to use cancellation tokens:

```csharp
using System;
using System.Threading;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main()
    {
        using var cancellationTokenSource = new CancellationTokenSource();
        CancellationToken cancellationToken = cancellationTokenSource.Token;

        // Start an asynchronous operation
        var task = PerformAsyncOperation(cancellationToken);

        // Simulate a cancellation request after 2 seconds
        await Task.Delay(2000);
        cancellationTokenSource.Cancel();

        try
        {
            // Await the task and handle potential exceptions
            await task;
            Console.WriteLine("Operation completed successfully.");
        }
        catch (OperationCanceledException)
        {
            Console.WriteLine("Operation was canceled.");
        }
    }

    public static async Task PerformAsyncOperation(CancellationToken cancellationToken)
    {
        try
        {
            while (true)
            {
                // Check for cancellation request before each step
                cancellationToken.ThrowIfCancellationRequested();

                // Simulate a step in the operation
                await Task.Delay(1000);
                Console.WriteLine("Step completed.");
            }
        }
        catch (OperationCanceledException)
        {
            Console.WriteLine("Operation was canceled.");
        }
    }
}
```

In this example:

- We create a `CancellationTokenSource` to generate cancellation tokens.
- We start an asynchronous operation using `PerformAsyncOperation` and pass in the cancellation token.
- After 2 seconds, we cancel the operation using `cancellationTokenSource.Cancel()`.
- We catch and handle the `OperationCanceledException` that is thrown when the operation is canceled.

Cancellation tokens allow you to implement cooperative cancellation in your asynchronous code, ensuring that operations can be safely canceled without causing resource leaks or unexpected behavior. They are especially valuable when working with long-running tasks or tasks that depend on external conditions for termination.
SAP BTP Kyma Metrics and Log export
Tags: sap, btp, kyma, logging
Published: 2023-11-02 15:25:41

## Need

Everyone of you would love to see logs from your application deployed on Kubernetes nice way. We all used to luxury having Kibana, Splunk, you name it. Unfortunately with SAP Kyma it is not available anymore. You need set it up by yourself to see them collected in one place.

In the past you could have loki exposed and then look at it using your Grafana instance locally. Unfortunately that part also gone.

https://blogs.sap.com/2022/11/02/deprecation-of-loki-based-application-logs-in-sap-btp-kyma-runtime/

https://blogs.sap.com/2023/06/02/removal-of-loki-based-application-logs-in-sap-btp-kyma-runtime/

You can still navigate to Pod's logs on [Kyma Dashboard](https://github.com/SAP-samples/btp-kyma-multitenant-extension/blob/main/documentation/troubleshooting/logviewer/README.md) or use `kubectl` from command line, but... that is not what we expect use in the long run.

Kyma offers `Log Pipeline` which I have tried to use, but for some reason I got an error with Grafana... If you would like to go through their docs, you can find that on [Kyma: Application Logs](https://kyma-project.io/#/telemetry-manager/user/02-logs?id=prerequisites) page.


## Solution

I have used free Grafana account to set it up their way. It was blazing fast. Start from user account page:


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

Alternatively you can find on the bottom of that page a shortcut:


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


1. find on home page "+ Connect Data" (`https://<user-account>.grafana.net/connections/add-new-connection`).
2. select "Kubernetes monitoring" and create token
3. follow their `helm` installation

Code snippet, which has been generated for my account looked like this:

```yaml
helm repo add grafana https://grafana.github.io/helm-charts &&
helm repo update &&
helm upgrade --install grafana-k8s-monitoring grafana/k8s-monitoring --namespace "default" --create-namespace --values - <<EOF
cluster:
  name: services
externalServices:
  prometheus:
    host: https://prometheus-prod-13-prod-us-east-0.grafana.net
    basicAuth:
      username: "1244838"
      password: PASTE_AUTH_TOKEN
  loki:
    host: https://logs-prod-006.grafana.net
    basicAuth:
      username: "721487"
      password: PASTE_AUTH_TOKEN
opencost:
  opencost:
    exporter:
      defaultClusterId: services
    prometheus:
      external:
        url: https://prometheus-prod-13-prod-us-east-0.grafana.net/api/prom
EOF
```
When I run it on Kyma I got one error due to existing pods installed by default. Helm printed out solution for it in the console. I needed to add at the end one configuration entry:

```yaml
prometheus-operator-crds:
  enabled: false
```

After that I got a notification in console:

```bash
Release "grafana-k8s-monitoring" does not exist. Installing it now.
NAME: grafana-k8s-monitoring
LAST DEPLOYED: Thu Nov  2 15:23:43 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
```

and finally I could browse logs.
From Darkness to Light Managing Linux Servers with Web UI
Tags: linux, ansible, admin, cockpit
Published: 2023-11-02 15:23:49



Anyone who has managed Linux servers from Bash knows that it can be a bit like being a hacker. But  sysadmins prefer to control their servers with a web interface. This is where Cockpit comes in.

Cockpit is a free and open-source web-based management console for Linux servers. 

Because we have many servers, both VMs and bare metal, I think we should use the magic automation tool called Ansible. Check out the GitHub repository for more information.

link : https://github.com/Mouhamed-dridi/Ansible_with_Cockpit.git
Meet entr, the standalone file watcher
Published: 2023-11-02 15:23:36

I like to write about tools in my toolbelt I love, and entr is one of these preferred tools I enjoy using a lot.

Today I'm talking about [entr](https://eradman.com/entrproject/) – the Standalone File Watcher.

## What's `entr`?

[entr](https://eradman.com/entrproject/) ("Event Notify Test Runner"; [GitHub](https://github.com/eradman/entr/)), is a command-line tool written by [Eric Radman](https://github.com/eradman) that allows running arbitrary commands whenever files change.

It's not tied to any programming language, framework, platform, OS, etc. – it's a real standalone tool, pretty useful in a variety of scenarios.

## Usage

First, use `find` to craft a command that lists the files you're working with:

```sh
find . -name '*.md'
```

Then, just pipe it to `entr` with a command to be run whenever files change:

```sh
find . -name '*.md' | entr echo "Markdown files changed!"
```

entr has some very interesting options, like the ability to clear the screen before running the given command (so you get a cleaner output). To get a full list of options, check its `man` page with:

```sh
man entr
```

## Continuously testing with entr

As you might have guessed, one of the main use cases for entr is to rerun tests whenever files change. I'm an [Elixir](https://elixir-lang.org) engineer, and I use `entr` to run `mix test` continuously whenever I save an Elixir file.

This is the snippet I use to continuously test my Elixir library [SwissSchema](https://github.com/joeljuca/swiss_schema) while I'm working on it:

```sh
find -E lib test -regex '.*exs?$' | entr -c mix test
```

A snippet I obviously can't recall from the top of my head every time I need to run it. Luckily, this project has a `Makefile` with a task for it:

```Makefile
test.watch:
	find -E lib test -regex .*exs?$ | entr -c mix test
```

> 💡 I wrote two articles here on [DEV](https://dev.to) about Makefiles, one covering their overall utility and usage, and another with my Makefile setup for Elixir projects:
>
> - [Makefiles: a standard for project tasks ](https://dev.to/joeljuca/makefiles-a-standard-for-project-tasks-31b)
> - [My Makefile for Elixir/Phoenix ](https://dev.to/joeljuca/my-makefile-for-elixirphoenix-4ei9)

That's it. There's not much to learn, entr is really this awesome!
Moinuddin9777 | Contributor
Tags: hack23contributor, flutter, machinelearning, mobile
Published: 2023-11-02 15:04:29

### Intro
Sup! This is Moin, I am an open source enthusiast who works as a DevRel and writes code in Dart. Besides this I also make Machine Learning models(PS: Not of my own LOL) and just started crawling into web3 on how can mobile apps be decentralized to evolve into DApps. I lead the TensorFlow User Group (Tech Community) of Hyderabad, India.

#### My Tech Stack
> AI: 
>> TensorFlow, SciKit Learn, Pandas, Numpy, Anaconda, PySpark

> Mobile: 
>> Flutter, Dart, Firebase, AppWrite, FlutterFlow

>     

Here is my LinkedIn and GitHub account, Let's connect :  
 - [LinkedIn](https://linkedin.com/in/moinuddin9777)
 - [GitHub](https://github.com/moinuddin9777)


### Highs and Lows
> Highs: Curating an idea which turns a feature and the feature's PR gets accepted is the most light bulb thing ever happened to me in every open source contributions.

> Lows: As we know GitHub or GitLab is not some kind of networking platform where we can extensively chat so communication with the repo owner, maintainer and explaining a lot of stuff as precisely as possible becomes a challenge.


### Growth

Growth is not always exponential but after someone contributes to repositories out of his tech stack or tries something new it gives a bit of confidence saying yeah there is room for improvement and yeah there is always room for improvement.
Day 3 100 Days Of Code Challenge: - Revised functions of Set & HashMap
Tags: python
Published: 2023-11-02 15:03:28

Today I revised the functions of a python set i.e. 

Set is an unordered Collection of unique items.

> a = set() 
> a = {1,2,3,4}
> a.add(5) 
> a.remove(3)
> a.discard(3)//does not give an error 
> a[1] # Not Allowed 
> a[3] = 10 # Not Allowed 


HashMap is a dictionary. 

> Hashmap<String,Integer> map = new Hashmap<>(); 
> map.put("Harsha",10)
> map.get("Harsha") 
> map.containsKey("Harsha") 
> map.containsValue(10) 
> map.remove(10)