teleren/devto huggingface dataset:
Who's dev.to writer to follow?✍️ Ask CloudFlare AI
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-14 07:12:54

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

An app that gives you insight into a dev.to user’s posting/articles and allows you to determine if it aligns with your preference.

## Demo

Try it! https://devtofollow.pages.dev

![devtofollow app screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/of7iclm77cddjb9nh4pt.png)

## My Code

{% embed https://github.com/fahminlb33/devtofollow %} 

## Journey

I started this app in a creative fever, nearing the end of the challenge. I originally wanted to submit just one, but then new ideas started coming at the last minute, and now here we are.

This time, my idea is to use LLM models to summarize a dev.to user posts and giving me insight about the key topics of his/her posts to determine whether his/her posts apply to my liking. This should help me pick which users to follow and align with my interests.

The process starts with using the dev.to API to get the latest articles posted by a certain dev.to username, then I scraped the article content and summarized it using a BART model. Then, Mistral 7b further summarizes this summary, and if provided, the app also suggests whether the topics in those articles align with your preference.

Models used:

1. **Text Summarization**: `@cf/facebook/bart-large-cnn` to summarize the post content
2. **Text Generation**: `@hf/mistral/mistral-7b-instruct-v0.2` to paraphrase the post summaries and to generate post relevancy

Same as before, I built the web app using Vite, React, and Mantine and the backend using CloudFlare Page Functions.

## What I Learned

In this app, I performed a web scraping using CloudFlare Worker and one part of it is to extract text from HTML. Most libraries available at npm usually require DOM manipulation to extract the text, but in this case, we don’t have access to that. Fortunately, CloudFlare Worker runtime has another solution for this, the `HTMLRewriter`. Originally, `HTMLRewriter` is intended to transform HTML, not for data extraction. But fortunately, we can use it for extraction. Granted, this is the first time I used the API, but it is surprisingly simple to use. 

The future plan for this project is to integrate it with other CloudFlare services. For example, automatically scraping and summarizing an article using CRON triggers, and then sending it to an email or database. This way, we can have our own personalized newsfeed.
Do You Question Life's Unwritten Rules?
Tags: discuss
Published: 2024-04-14 07:00:00

Can you share a personal experience where questioning a long-held assumption led to positive change or growth?

How can we encourage a culture of critical thinking and curiosity to challenge assumptions in our workplaces or communities?
<br>
Follow the DEVteam for more discussions and online camaraderie!
{% embed https://dev.to/devteam %}
KodeStyle: Let's style the way we code and show!
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-14 06:42:14

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

KodeStyle is a platform for developer that uses amazing AI models provided by cloudfare to do operational works to showcase our project ( devs' pov ), it helps us with creating customized beautiful readmes, analyse code, manage our social media posts, summarizes docs from a webpage using beautifulsoup, and let the developers have custom api keys and apis to run the following using python or any other programming language, it also has the feature to push readme directly to the repos using github rest apis!

## Demo


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

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


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


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


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


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



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



## Try it out here!
https://kode-style.vercel.app/


## My Code

https://github.com/0Armaan025/kodestyle
https://github.com/0Armaan025/kodestyle-api
https://github.com/0Armaan025/kodestyle-ai-api

## Journey

The journey started when I learned that there is this hackathon/event going on, I was really interested to polish my react skills with making something that will be really useful, so came the idea of making kodestyle, at the exact moment when I saw that we had to publish a blog about our project! it's been a tough journey because of assignments, late nights, and overflowing bugs.

**Multiple Models and/or Triple Task Types**

Our project uses these models:

@cf/stabilityai/stable-diffusion-xl-base-1.0 = used before to create images
@cf/openchat/openchat-3.5-0106 = tried to summarize docs
@cf/google/gemma-7b-it-lora = used for code review and analysis, and docs/readmes making
@cf/meta/llama-2-7b-chat-fp16 = used for posts (social media)

Made by me!



Thanks for organizing an amazing event, Dev.to and cloudfare team, thanks!
KodeStyle: Let's style the way we code and show!
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-14 06:42:10

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

**NOTE: I started editing this 10 mins before the deadline and now editing it at 3:37 pm IST, after 3 hours 37 minutes of the deadline, some features may not work now because of a revoked token, and please do NOT abuse the usage because the api only allows us the usage of 10k neurons, <- editing after help from an amazing developer from the cloudfare discord server!**

## What I Built

KodeStyle is a platform for developer that uses amazing AI models provided by cloudfare to do operational works to showcase our project ( devs' pov ), it helps us with creating customized beautiful readmes, analyse code, manage our social media posts, summarizes docs from a webpage using beautifulsoup, and let the developers have custom api keys and apis to run the following using python or any other programming language, it also has the feature to push readme directly to the repos using github rest apis!

## Demo


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

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


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


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


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


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



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



## Try it out here!
https://kode-style.vercel.app/


## My Code

https://github.com/0Armaan025/kodestyle
https://github.com/0Armaan025/kodestyle-api
https://github.com/0Armaan025/kodestyle-ai-api

## Journey

The journey started when I learned that there is this hackathon/event going on, I was really interested to polish my react skills with making something that will be really useful, so came the idea of making kodestyle, at the exact moment when I saw that we had to publish a blog about our project! it's been a tough journey because of assignments, late nights, and overflowing bugs.

**Multiple Models and/or Triple Task Types**

Our project uses these models:

@cf/stabilityai/stable-diffusion-xl-base-1.0 = used before to create images
@cf/openchat/openchat-3.5-0106 = tried to summarize docs
@cf/google/gemma-7b-it-lora = used for code review and analysis, and docs/readmes making
@cf/meta/llama-2-7b-chat-fp16 = used for posts (social media)

Made by me!



Thanks for organizing an amazing event, Dev.to and cloudfare team, thanks!
JS Bites: Chapter 4 - Fetch API
Tags: javascript, webdev, programming, beginners
Published: 2024-04-14 06:11:25

**Fetch API**

`fetch()`is a function used to send the requests to APIs and retrieve data.

```js
const response = fetch('someapi.com');
```

**How Does It Work?**

When you pass the URL to `fetch()`, JavaScript creates a request object internally.

```js
// Internal working
const request = new Request('someapi.com', {
   method: 'GET'   
});

const response = fetch(request);
```
The above demonstrates the initial workings of `fetch()`, abstracting away the complexities for you.

**Response Object**

`fetch()` is asynchronous, returning a promise that resolves later.

```js
const url = "https://jsonplaceholder.typicode.com/todos/1"; 

async function fetchData() {
    const response = await fetch(url);
    console.log(response);
}

fetchData();

```
This will output the response object. To obtain data, you need to convert the response object into JSON.

```js
const url = "https://jsonplaceholder.typicode.com/todos/1";

async function fetchData() {
    const response = await fetch(url); 
    const data = await response.json();
    console.log(data.title);
}

fetchData();
```

**GET Requests Parameters**

For specific data, parameters can be added to the URL, but this method isn’t secure, For safety, include parameters in the request object.

```js
const url = 'someUrl';

async function getData() {
    const request = new Request(url, {
        headers: {
            'Authorization': 'token'    
        }
    });

    const response = await fetch(request);
    const data = await response.json();
    console.log(data);
}

getData();
```

**Error Handling**

Handle errors properly. If the request is successful but the data retrieval fails. it’s still considered a success.

let’s handle the error if the request is made successfully but the data retrieval fails. Check the status code for error handling.

```js
try {
    const response = await fetch(request);
    if (response.status === 200) {
        const data = await response.json(); 
        console.log('Success', data);
    } else {
        console.log('Server error', data.error.message);
    }
} catch(error) {
    console.log(error);
}
```

**POST Request**

When you send data to a server, like when submitting a form, you can use the `POST` method. To do this with `fetch()`, you need to include the data you want to send in the request body.

```js
const request = new Request(url, {
    headers: {...},
    body: {...}
});
```

---

For more detailed information on the Fetch API, refer to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

Comment your thoughts…

See you in the next chapter…
BJ88 TUBE - Nhà Cái Cá Cược Đá Gà Thomo Thể Thao Uy Tín
Tags: bj88
Published: 2024-04-14 06:03:57

[BJ88](https://bj88.tube/) TUBE không chỉ là địa chỉ cá cược đá gà Thomo và thể thao uy tín mà còn là điểm đến lý tưởng cho những ai yêu thích giải trí trực tuyến. Nơi đây mang đến cho bạn một kho tàng trò chơi đa dạng với nhiều thể loại khác nhau, đáp ứng mọi sở thích và nhu cầu của người chơi.
Trải nghiệm các trò chơi đổi thưởng hấp dẫn:
BJ88 TUBE cung cấp cho bạn nhiều trò chơi đổi thưởng quen thuộc như Tiến lên miền Nam, Phỏm, Mậu binh, Xì tố,... với giao diện đẹp mắt, âm thanh sống động và luật chơi đơn giản. Tham gia các trò chơi này, bạn có cơ hội thử thách bản thân, rèn luyện trí tuệ và kiếm thêm thu nhập.
Khám phá thế giới bắn cá đầy màu sắc:
Bắn cá trực tuyến tại BJ88 TUBE là một trải nghiệm giải trí thú vị và đầy thư giãn. Với giao diện 3D sống động, hệ thống vũ khí đa dạng và nhiều loài cá đẹp mắt, bạn sẽ có cảm giác như đang được khám phá thế giới đại dương huyền bí.
Tham gia xổ số trực tuyến với tỷ lệ trúng thưởng cao:
BJ88 TUBE cung cấp cho bạn nhiều hình thức xổ số trực tuyến khác nhau như xổ số 3 miền, xổ số siêu tốc,... với tỷ lệ trúng thưởng cao. Tham gia xổ số tại đây, bạn có cơ hội đổi đời chỉ sau một đêm.
Vui nổ hũ với các trò chơi slot hấp dẫn:
BJ88 TUBE sở hữu kho tàng trò chơi slot khổng lồ với nhiều chủ đề đa dạng và tỷ lệ trúng thưởng cao. Tham gia các trò chơi slot, bạn có cơ hội giải trí và kiếm tiền một cách dễ dàng.
Thông tin liên hệ:
BJ88 TUBE
Website: [https://bj88.tube/](https://bj88.tube/)
Hotline: 0796910059
Email: bj88tubevn@gmail.com
Địa chỉ: 50 Đường 297, Phước Long B, Quận 9, Thành phố Hồ Chí Minh
[https://www.google.com/maps?cid=3647979334079848219](https://www.google.com/maps?cid=3647979334079848219)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zumzi0j2pp3b7g1ht2m.jpg)
Bun Runtime - Introduction (Part 1)
Tags: bunjs, javascript, cleavr, typescript
Published: 2024-04-14 06:02:41

[Bun](https://bun.sh/) is a [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) runtime built to serve the modern JS ecosystem. Aside from being a JavaScript runtime, Bun is a bundler, test runner, and NodeJS-compatible package manager.

While [NodeJS](https://nodejs.org/en) remains a stable and popular choice as a runtime for JavaScript and [TypeScript](https://www.typescriptlang.org/) apps, Bun prioritizes speed and developer experience.

Without further delay, let's jump in and install Bun so that we can explore more of what it has to offer.

I’ll be using the [Ubuntu](https://ubuntu.com/) 22.04 server from [Hetzner](https://www.hetzner.com/) throughout this blog. If you’re on a different platform please visit Bun’s installation [documentation](https://bun.sh/docs/installation).

To install Bun run the following command on your terminal:

`curl -fsSL https://bun.sh/install | bash`

![Bun Installation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evwkfsqtta8047jvgcf7.png)

As you can see in the screenshot, I successfully installed Bun. And the download path is in `~/.bun/bin/bun`.

Since Bun is installed as a root user, other system users may be unable to use Bun.


![Bun Download Path](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvibw8ninfad258fepxz.png)

As you can see in the screenshot above, I was able to run the bun –version command while the root user was running the command. As soon as I switched the user to cleavr, which is a non-root user, I was unable to run the same command.

To resolve this issue, you can copy the Bun installation to the `/usr/local/bin/` directory. The `/usr` directory stores read-only files that can be shared among system users.

`cp /root/.bun/bin/bun /usr/local/bin/bun`

![Bun System Wide Use](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7mh0o6kwa9ev58djazjc.png)

Once you’ve successfully installed Bun, you can start building your projects using Bun. To scaffold an empty project, run the bun init command.

![Bun Scaffold Project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wgmlhw4nikmn9r9gv9ix.png)

The `bun init` command asks you to provide answers to a few prompts, you can provide the input or just press enter to accept the default answer for each prompt.

It creates the required files to scaffold a minimal Bun project such as `package.json`, `index.ts file`, etc. 
At the end it also runs bun install to install the required dependencies.

You can now run `bun run index.ts` to execute a source file.

![Bun Run Project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43ekbjhejtim72byjdgc.png)

In this blog, we’ve installed the Bun runtime, scaffolded, and ran a new project using Bun runtime. I hope this blog helps you with setting up and running your projects using Bun.

In the next part of this blog, we’ll set up a [Nuxt](https://nuxt.com/) application with Bun.

This content was originally posted on [Cleavr](https://cleavr.io/cleavr-slice/bun-runtime-introduction).
Multiple SSH id
Tags: ssh, git, github, commit
Published: 2024-04-14 06:00:00

Using multiple SSH keys with GitHub allows you to manage access to multiple GitHub accounts or repositories from the same computer or development environment. Here's how you can set it up:

1. **Generate SSH Keys**: First, generate SSH keys for each GitHub account or repository you want to access. You can generate SSH keys using the `ssh-keygen` command in your terminal or command prompt. Make sure to specify a unique name and location for each SSH key pair.

   ```bash
   ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
   ```

   When prompted, specify a unique filename for the SSH key pair (e.g., `id_rsa_github1`, `id_rsa_github2`, etc.) and optionally set a passphrase for added security.

2. **Add SSH Keys to SSH Agent**: Use the `ssh-add` command to add each SSH private key to the SSH agent. This allows the SSH agent to manage your SSH keys and automatically use them when authenticating with GitHub.

   ```bash
   ssh-add ~/.ssh/id_rsa_github1
   ssh-add ~/.ssh/id_rsa_github2
   ```

3. **Configure SSH Config File**: Create or edit the SSH config file (`~/.ssh/config`) to specify which SSH key to use for each GitHub host. You can use the `IdentityFile` directive to specify the path to the SSH private key.

   ```bash
   # GitHub account 1
   Host github.com
     HostName github.com
     User git
     IdentityFile ~/.ssh/id_rsa_github1

   # GitHub account 2
   Host github-secondaccount
     HostName github.com
     User git
     IdentityFile ~/.ssh/id_rsa_github2
   ```

   In this example, `github-secondaccount` is a custom alias for the second GitHub account to avoid conflicts with the default `github.com`.

4. **Add SSH Public Keys to GitHub**: Copy the contents of each SSH public key (`id_rsa_github1.pub`, `id_rsa_github2.pub`, etc.) and add them to the SSH keys section in the GitHub account settings.

5. **Test SSH Connection**: Finally, test the SSH connection to GitHub to ensure everything is set up correctly.

   ```bash
   ssh -T git@github.com
   ssh -T git@github-secondaccount
   ```

   You should see a success message confirming the connection to GitHub.

With these steps, you can use multiple SSH keys to authenticate with GitHub and access repositories associated with different GitHub accounts or organizations from the same computer or development environment.
Inbox Invasion: The Ultimate Spam Content Calculator
Tags: cloudflarechallenge, devchallenge, ai, marketing
Published: 2024-04-14 05:44:31

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What We Built

Email marketing is a vast and lucrative field, and professionals understand its immense value. The golden rule of email marketing is crystal clear: your email must land in the inbox, not the spam folder. That's where the real treasure lies. Email delivery involves many factors such as domain scores and more, but content is king. That's why we've developed an AI that helps you enhance your email content, making it more spam-resistant. Let our AI do the heavy lifting, so you can reap the rewards and strike gold!

## Demo

[App Link](https://dev-cloudflare-ai.dhruvlol12.workers.dev)

![App Screen short](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfk4hi5gmz309tgisdbw.png)

## My Code

 {% embed https://github.com/aixart12/cloudflare-ai-email-analysis %}

## Journey

<!-- Tell us about your process, the task types and models you used, what you learned, anything you are particularly proud of, what you hope to do next, etc. -->

**Genesis of the Spam Slayer**

The Tale of Inbox Invasion: Ultimate Spam Content Calculator—a masterpiece crafted to determine the likelihood of an email being marked as spam and strategies to avoid it. The inspiration for this project came from a lunch conversation with a marketing colleague who expressed frustration about their emails consistently landing in spam, despite their efforts and without understanding why.

**Fueling Innovation with Competition**

Motivated by an upcoming contest, we decided to build a tool to help users understand spam rules better and craft their emails more effectively. Our research began with exploring the filters used by email services, including a deep dive into Cloudflare, which was a new area for us. We then moved on to developing the app, with plans to evolve it into a plugin for every email service provider, complete with a variety of pre-designed templates to minimize the time and effort spent on writing emails.

**Tech Stack and Tools**

Technologies used included JavaScript, HTML, CSS, and Hono, with the @cf/meta/llama-2-7b-chat-int8 model.

**Triumph Amidst Trials**

One aspect we're particularly proud of is how we managed our time. Balancing this project with our regular 9-to-9 jobs and a tight one-week deadline was a significant challenge. We faced numerous hurdles, such as acquiring email data for testing and aligning with the marketing team's needs, which were initially unfamiliar territories for us. Despite these challenges, the experience was thrilling and rewarding.


<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->
## The Team

 @diaaswani 

<!-- Don't forget to add a cover image or an additional tag to this post (if you want). -->

<!-- Thanks for participating! -->
ACID properties of a database system.
Tags: database, webdev
Published: 2024-04-14 05:43:09

This is a quick refresher on the acid properties of database system.
ACID stands for:

1. Atomicity
2. Consistency
3. Isolation
4. Durability
Let's go over each one in detail.

## ATOMICITY
This ensures that if a database transaction fails or one of its queries fails, then the whole transaction should fail and the database will be reverted to its previous state.

## CONSISTENCY
This ensures that a database is in a valid state after a given transaction as per the constraints enabled in the database table.

## ISOLATION
This ensures that concurrent transactions will result in the same results in the database if the same set of transactions were executed sequentially.

## DURABILITY
This ensures that once a transaction has been committed to the database successfully, it will always be available irrespective of a catastrophic event such as a power cut or network failure.