teleren/devto huggingface dataset:
Elevate Your Living: Ultimate Eve Smart Home Setup Guide 🏡✨ | 100% Worth the Upgrade? 🤔🔧
Tags: smartcontract, ai, home, automation
Published: 2024-01-03 16:00:00

Hello, since Rumble had some issue in code and stopped uploading videos, I needed to recreate my channel now it all works and the Devs checked so republishing my videos:

{% embed https://rumble.com/v44htzx-elevate-your-living-ultimate-eve-smart-home-setup-guide-100-worth-the-upgra.html?mref=2xhj9j&mc=cm8uy %}

Follow for more on 
YouTube: [Link](https://www.youtube.com/@valters_eu)
Twitter: [Link](https://twitter.com/valters_eu)
Rumble: [Link](https://rumble.com/c/c-5535633)
Website: [Link](https://www.valters.eu/)

Thanks
The project that will make you enjoy writing tests for your Django app
Tags: pytest, python, django, djangorestframework
Published: 2024-01-03 15:35:44

---
title: The project that will make you enjoy writing tests for your Django app
published: true
description: a pytest fixture that makes your django testing enjoyable 
tags: pytest, python, django, djangorestframework
---
Hi all! I’m proud to share my new first open-source project drf-api-action, and I’d be glad to receive your feedback!

https://github.com/Ori-Roza/drf-api-action

This project was built as a side project at work in which we had to tweak DRF for our own needs, this project was successful back then so I wanted to publish it to everyone

The drf-api-action Python package is designed to elevate your testing experience for Django Rest Framework (DRF) REST endpoints by treating REST endpoints as regular functions!

Features:

* Simplified Testing: Testing DRF REST endpoints using the api-action decorator, treating them like regular functions.

* Seamless Integration: Replacing DRF's action decorator with api-action in your WebViewSet seamlessly or using it as a pytest fixture.

* Clear Traceback: Instead of getting a response with error code, get the real traceback that led to the error.

* Pagination Support: Paginating easily through pages by a single kwarg.

Here's a snippet with new pytest fixture addition:

```python
from .models import DummyModel
from rest_framework import status
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from rest_framework.serializers import IntegerField, ModelSerializer, Serializer


class DummySerializer(ModelSerializer):
    dummy_int = IntegerField()

    class Meta:
        model = DummyModel
        fields = "__all__"

class DummyViewSetFixture(ModelViewSet):
    queryset = DummyModel.objects.all()
    serializer_class = DummySerializer

    @action(detail=True, methods=["get"], serializer_class=DummySerializer)
    def api_dummy(self, request, **kwargs):
        serializer = self.get_serializer(instance=self.get_object())
        return Response(data=serializer.data, status=status.HTTP_200_OK)
```
```python
import pytest
from tests.test_app.models import DummyModel
from tests.test_app.views import DummyViewSetFixture
from drf_api_action.fixtures import action_api

@pytest.mark.action_api(view_set_class=DummyViewSetFixture)
def test_call_as_api_fixture(db, action_api):
    dummy_model = DummyModel()
    dummy_model.dummy_int = 1
    dummy_model.save()
    res = action_api.api_dummy(pk=1)
    assert res["dummy_int"] == 1
```

Please let me know what you think, Your feedback means a lot to me!
HOW TO HOST YOUR STATIC WEBSITE ON CloudflarePAGES
Tags: webdev, html, css, staticweb
Published: 2024-01-03 15:31:24


Hey budding web developer transitioning into the world of codes and bugs. You have probably spent a considerable amount of time perfecting your skills through markup and programming languages, and now you have built a website that you are eager to show to your group or use as part of a portfolio. You have built it on your system or device, so what’s left is to put it up somewhere. There are different free sites where one can deploy a static web from GitHub pages, Netlify, and CloudfarePages. I choose CloudfarePages because of its simple approach for newbies using HTML, CSS, and JavaScript bits. However, it should be noted that to deploy your site on Cloudfare as with most other static site deployments, you will have to create a Github repository where you upload the files of your web design. You can sign up to cloudfarepages on https://dash.cloudflare.com. On your dashboard, select Workers & Pages > Create application > pages > connect to git. Then, Select the new GitHub repository that you created and, in the Setup builds and deployments section, provide the following information:

Framework Preset        None 

Production branch	main
Build command     (leave empty if there are none use *JEKEYLL BUILD)
Build output directory	(can be “/_SITE”)

After you have finished setting your build configuration, select Save and Deploy. Your project build logs will be output as Cloudflare Pages installs your project dependencies, builds the project, and deploys it to Cloudflare’s global network.
Protect your online Browsing or business with KASM. This video is for Educational purposes!
Tags: cybersecurity, hacking, developers, development
Published: 2024-01-03 15:30:00

Hello, since Rumble had some issue in code and stopped uploading videos, I needed to recreate my channel now it all works and the Devs checked so republishing my videos:

{% embed https://rumble.com/v44c37q-protect-your-online-browsing-or-business-with-kasm.-this-video-is-for-educa.html?mref=2xhj9j&mc=cm8uy %}

Follow for more on 
YouTube: [Link](https://www.youtube.com/@valters_eu)
Twitter: [Link](https://twitter.com/valters_eu)
Rumble: [Link](https://rumble.com/c/c-5535633)
Website: [Link](https://www.valters.eu/)

Thanks
Predicciones 🧞‍♀️💻 2024
Tags: webdev, programming, discuss, spanish
Published: 2024-01-03 15:28:21

Algunos puntos que deberías prestar atención para este año 2024 que seguro tendrán un alto impacto en el ecosistema tecnológico.

1. **Bun logra su objetivo de convertirse en el runtime predeterminado para frontend:** Todavía tienen algunos obstáculos que superar, pero si logran proporcionar un reemplazo directo para Node que mejore instantáneamente el rendimiento de su aplicación 10 veces, será una opción obvia para la mayoría de los desarrolladores. El lanzamiento v1.0 de septiembre pasado fue un paso importante hacia la compatibilidad y la estabilidad general de Windows, y la apuesta es a que Bun comience a convertirse en la opción predeterminada este año.

2. **La IA reemplazará las herramientas no-code/low-code:** Resulta que la IA es mucho mejor y más rápida a la hora de crear paneles de análisis de marketing. Herramientas como [Basedash](https://www.basedash.com/) y [8base](https://archie.8base.com/) ya utilizan IA para crear un conjunto completo de requerimientos, herramientas internas personalizadas, y surgirán otras para reemplazar a los builders de arrastrar y soltar para crear sitios que no dependan en gran medida de la lógica empresarial.

3. **Netlify es adquirida por GoDaddy:** Con múltiples rondas de despidos, 2023 claramente no fue el mejor año para Netlify. Pero a veces la mejor manera de recuperarse es buscarse un nuevo ~~sugar daddy~~, GoDaddy. Después de retirar la marca Media Temple hace unos meses, parece que GoDaddy podría volver al mercado de adquisiciones para una plataforma como Netlify.

Alguna otra que se te ocurra? Ayudame actulizar este post!! 


![Profile](https://res.cloudinary.com/khriztianmoreno/image/upload/c_scale,w_148/v1591324337/KM-brand/stickers/sticker-3_2x.png)


### @khriztianmoreno 
Hasta la próxima.
The Twelve-Factor App: Disposability
Tags: learning, writing, architecture, devjournal
Published: 2024-01-03 15:25:08

### Maximize robustness with fast startup and graceful shutdown

---

**The Twelve-Factor app's processes are designed to be disposable, allowing them to be started or stopped at any moment.** This flexibility accelerates elastic scaling, rapid deployment of code or configuration changes, and ensures the resilience of production deployments.

Efforts should be made to **minimize the startup time of processes.** Swift startups provide greater agility for the release process and scaling up, contributing to robustness as the process manager can easily transfer processes to new physical machines when needed.

**Processes shut down gracefully when they receive a `SIGTERM`** signal from the process manager. In the case of a web process, this entails ceasing to listen on the service port (rejecting new requests), allowing ongoing requests to be completed, and then exiting. For instance, in the case of a worker process, graceful shutdown involves returning the current job to the work queue. In `RabbitMQ`, a worker can send a NACK to accomplish this.

Processes should also be resilient against abrupt termination, which could result from hardware failures. Although less common than graceful shutdowns with SIGTERM, such incidents can occur. An advisable strategy involves utilizing a robust queueing backend like Beanstalkd, which returns jobs to the queue upon client disconnection or timeouts. In any scenario, a twelve-factor app is structured to handle unexpected, non graceful terminations. The crash-only design embodies this principle to its logical conclusion.

_This Twelve-Factor App post series is a means for me to consolidate the knowledge I've gained while studying these rules. Please feel free to visit [the site (https://12factor.net/) for more detailed explanations. That's all folks!_
What is aliasing in Ubuntu?
Tags: beginners, ubuntu, discuss, productivity
Published: 2024-01-03 15:22:09


## Problem 
So, I have recently started using Ubuntu and I often face the problem of typing the same commands again and again. We know that 80% of the commands that we use everyday are only 4 or 5 of them. It sometimes becomes frustrating as well as time-consuming. Well, this is not how I want to make use of my precious time. What should I do then?

## Solution
Well, I came across the concept of aliasing today which made me realise that this is the exact solution to my problem. You must be wondering that what does aliasing mean? Let me try to tell what I understand by it. Aliasing simply means giving a nickname to something. 

Suppose, a friend of yours has a name "Ramakrishna". You'd rather call him R.K. instead of addressing him by his name everyday. So, R.K. is his nickname. Similarly, we can give nicknames to our daily use commands. Thus, this is called aliasing.

In order to make aliases, you can use the following steps:

1. Firstly, go to your terminal and open the `.bashrc` file on `gedit` so that you can edit your file.

	`gedit ~/.bashrc`
	
2. Once, the `gedit` text editor is opened, create the alias and save the file.

	`alias <nickname> ='The command you want to give a nickname to'`
	`alias ll='ls -l' //Command to show all the files in your system
	`
3. Kill the current terminal and reopen it. Then execute ll

 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r7h59lcrtw8tmtjkxbkw.png)
 
Voila!! Now you can view all the files in detail. This is one such example of aliasing.

One specific use case of aliasing is when there's a file that's nested deeply within multiple directories. In such scenario, writing the whole path to access it would be a waste of time. 

It can also be used when we are regularly pulling and pushing our code to remote repositories such as on GitHub. Suppose, we can give an alias to git add as:

`alias ga='git add .'`

## Limitations
We know that every thing has its own benefits and limitations. This goes for aliasing as well.
It is very important for us to know when is it of use and when it's not. 

Let's take an example where you have created some aliases on your own system and you are so dependent on them, that if given another system, you wouldn't be able to execute the actual commands. So depending entirely on anything is wrong.

Also, aliasing should be used only when you need to repeatedly use some command. Creating an alias for a command that only needs to be used once does not make any sense. Suppose, you can execute a direct command in one minute, whereas creating an alias and executing it takes more time that to when that command only needs to be run once. 

Thus, I would like to conclude by saying that aliasing can be greatly useful to us provided we keep in mind its use cases.
Advent of Code 2023 - DAY 11
Tags: rust, adventofcode
Published: 2024-01-03 15:17:10

#Problem Day 11: Cosmic Expansion
Here the day 11 problem statement: [https://adventofcode.com/2023/day/11](https://adventofcode.com/2023/day/11)

## Solution Part 1
```rust
pub fn build_galaxies(input: &str) -> Vec<(usize, usize)> {
    let mut galaxies: Vec<(usize, usize)> = Vec::new();

    for (i, row) in input.lines().enumerate() {
        for (j, col) in row.chars().enumerate() {
            if col.eq(&'#') {
                galaxies.push((i, j))
            }
        }
    }
    galaxies
}

pub fn extract_empty_rows(galaxies: &mut Vec<(usize, usize)>) -> Vec<usize> {
    let mut empty_rows: Vec<usize> = Vec::new();

    galaxies.sort_by(|a, b| a.0.cmp(&b.0));

    for i in 0..galaxies.len() - 1 {
        if galaxies[i + 1].0 - galaxies[i].0 > 1 {
            for j in galaxies[i].0 + 1..galaxies[i + 1].0 {
                empty_rows.push(j);
            }
        }
    }

    empty_rows
}

pub fn extract_empty_cols(galaxies: &mut Vec<(usize, usize)>) -> Vec<usize> {
    let mut empty_cols: Vec<usize> = Vec::new();

    galaxies.sort_by(|a, b| a.1.cmp(&b.1));

    for i in 0..galaxies.len() - 1 {
        if galaxies[i + 1].1 - galaxies[i].1 > 1 {
            for j in galaxies[i].1 + 1..galaxies[i + 1].1 {
                empty_cols.push(j);
            }
        }
    }

    empty_cols
}

pub fn expand_galaxies(
    galaxies: &mut [(usize, usize)],
    empty_rows: &[usize],
    empty_cols: &[usize],
    rate: usize,
) {
    for galaxy in galaxies {
        let num_step_x = empty_rows.iter().filter(|r| **r < galaxy.0).count() as usize;
        let num_step_y = empty_cols.iter().filter(|c| **c < galaxy.1).count() as usize;

        galaxy.0 += (num_step_x * (rate - 1)) as usize;
        galaxy.1 += (num_step_y * (rate - 1)) as usize;
    }
}

pub fn solve(input: &str, rate: usize) -> usize {
    let mut galaxies: Vec<(usize, usize)> = build_galaxies(input);
    let empty_rows: Vec<usize> = extract_empty_rows(&mut galaxies);
    let empty_cols: Vec<usize> = extract_empty_cols(&mut galaxies);

    expand_galaxies(&mut galaxies, &empty_rows, &empty_cols, rate);

    let mut distances_sum: usize = 0;
    for i in 0..galaxies.len() {
        for j in i + 1..galaxies.len() {
            let distance = (galaxies[i].0 as i32 - galaxies[j].0 as i32).abs()
                + (galaxies[i].1 as i32 - galaxies[j].1 as i32).abs();

            distances_sum += distance as usize;
        }
    }

    distances_sum
}

pub fn part1(input: &str) -> usize {
    solve(input, 2)
}
```
## Solution Part 2
```rust
pub fn part2(input: &str) -> usize {
    solve(input, 1_000_000)
}
```
[Here](https://github.com/fushji/advent-of-code-2023) the repository with all puzzle solutions.
XRPL in December 2023: A Leap Forward into 2024
Tags: xrpl, blockchain, xrp, cryptocurrency
Published: 2024-01-03 15:11:48

Happy New Year to all the XRPL fans out there! As we step into 2024, let's take a moment to reflect on the incredible progress our community achieved in December 2023. That month was more than just a calendar page turning; it showcased the resilience, growth, and creativity that's thriving in the XRPL world.

### December: A Banner Month

**31% More Active Traders**  
Seeing the number of active traders jump up by 31% in December really underscored the growing interest in XRPL. It's not just about the figures; it's about a community coming to life, full of energy and enthusiasm.

**DEX Volume Jumped by 84%**  
The DEX volume in December wasn't just good; it was fantastic, shooting up by 84%. This isn't just another number. It reflects the lively trade happening in our marketplace and the trust our community has in XRPL's decentralized platform.

**Market Cap Grew by 38%**  
The significant leap in market capitalization is a clear indicator of our assets' growing value and potential. It shows that our ecosystem is not just surviving; it's thriving, with innovation at its heart.

### The NFT Market: Lessons Learned

2023 was a challenging year for the NFT market within XRPL, but remember, with every challenge comes opportunity. These obstacles aren't setbacks; they're chances for us to learn, adapt, and come back even stronger.

### What's Next: The 2024 Vision

The token market's rebound in December is just a taste of what we're capable of achieving in 2024. As we celebrate our recent successes, we're also gearing up for a year filled with breakthroughs and progress. The future of XRPL is shining bright, filled with endless possibilities for growth, innovation, and achievement.

### The Strength of Our Community

On this exciting journey, the power of teamwork and community spirit becomes increasingly clear. The collective drive and passion of the XRPL community are our biggest assets. Together, there's no limit to what we can discover and achieve.

### Wrapping Up: The Year Ahead Promises More

Let's take the energy and achievements from December and propel ourselves into an even more successful 2024. The past month's achievements are just the start. Here's to a future brimming with new opportunities, triumphs, and pioneering innovations in the XRPL community.

The XRPL ecosystem is more than a platform; it's a vibrant movement. Let's keep this exciting story going as we push forward in the realm of decentralized finance and digital assets.
Teamlinker:A new generation of team collaboration open source platform based on Node.js
Tags: javascript, node, vue, typescript
Published: 2024-01-03 15:11:29

📝 Introduction
Teamlinker is a team collaboration platform that integrates multi-functional modules, covering aspects such as team member contact, task assignment, meeting opening, transaction arrangement, and file management.

📋 Official website
https://team-linker.com

📖 Open source
Github: https://github.com/Teamlinker/Teamlinker
String taqqoslash
Published: 2024-01-03 15:10:41

👨🏻‍💻 Satrlarni solishtirish uchun statik Compare() methodi qo'llaniladi.

Taqqoslash methodining ushbu versiyasi ikkita satrni oladi va raqamni qaytaradi. Agar birinchi satr alifbo tartibida ikkinchisidan yuqori bo'lsa, u holda noldan kichik raqam qaytariladi. Aks holda, noldan katta raqam qaytariladi. Va uchinchi holat -1 agar satrlar teng bo'lsa, u holda 0 raqami qaytariladi.

Bunda 'h' belgisi alifbo tartibida 'w' belgisidan yuqori bo'lgani uchun birinchi qator balandroq bo'ladi.
CakeAdmin: Free Bootstrap 5 Admin Dashboard Template
Tags: html, javascript, bootstrap, admintemplate
Published: 2024-01-03 15:04:42

CakeAdmin is a professional admin dashboard template that comes with over 100 components, forms, tables, pre-built pages, charts, and icons. It is built on Bootstrap 5, offering the opportunity to accelerate application development. It assists in providing a top-notch user experience.

[Click to get this template.](https://cakeadmin.com)

![CakeAdmin Free Bootstrap 5 Admin Template](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqwxd4tycl177hcwsg4u.jpg)

Are you tired of spending excessive time on designing and developing the admin panel for your web applications? Say hello to CakeAdmin – a dedicated admin template designed to simplify the process of creating modern and efficient admin interfaces.

## Quick Setup and Usage
CakeAdmin offers a straightforward installation process, allowing developers to get started swiftly. With various pre-designed components and layouts, customization becomes a breeze.

## Component Library
A rich library of components includes elements such as charts, form elements, tables, and attribute panels. Developers can easily integrate these components to enhance the functionality of their applications.

## Responsive Design
CakeAdmin boasts a responsive design, ensuring seamless functionality across a variety of devices. The admin panel adapts gracefully to mobile devices, providing a consistent user experience.

## Modern and Stylish Look
The user interface is enriched with modern design principles and user-friendly elements. This ensures that your application exudes a professional and contemporary appearance.

## Developer-Friendly Documentation
Detailed and comprehensible documentation guides developers through the template's usage. This empowers developers to harness the full potential of the template efficiently.

CakeAdmin is designed to save developers time and effort, streamlining the process of customizing admin panels for web applications. Offering a professional appearance, user-friendly features, and a robust foundation, CakeAdmin is the ideal solution to enhance the efficiency of managing your web application's administration.

Don't let admin panel development be a time-consuming task. With CakeAdmin, empower your projects with a visually appealing and functionally efficient admin interface, bringing a new level of ease to your web development workflow. Try CakeAdmin today and experience the difference!

## Download

```
git clone https://github.com/bundui/cakeadmin.git
```
or [Click to get this template.](https://cakeadmin.com)
A Guide to Converting ASCII to Characters in JavaScript
Tags: javascript, react, typescript
Published: 2024-01-03 15:04:40

## Introduction:

In the vast world of programming, understanding the fundamentals is crucial. One such fundamental concept is ASCII (American Standard Code for Information Interchange). ASCII codes, representing characters as numerical values, play a vital role in various applications. This post will teach us how to use JavaScript to convert ASCII codes to characters.

## Understanding ASCII:

ASCII is a character encoding standard that assigns a unique numerical value to each character. For example, the ASCII code for the letter 'A' is 65, 'B' is 66, and so on. This encoding scheme allows computers to represent text characters in a standardized way.

## The Journey Begins: Writing the Conversion Function:

In JavaScript, the process of converting ASCII codes to characters is straightforward. We can leverage the `String.fromCharCode()` method to achieve this transformation. Let's explore a simple function that encapsulates this process:

```
const ASCIIToChar = (asciiCode) => {
  return String.fromCharCode(asciiCode);
};

```

`The String.fromCharCode()` method takes one or more Unicode values and returns the corresponding characters. In this case, we provide it with a single ASCII code to obtain the character it represents.

## Putting the Function to the Test:

Now that we have our conversion function, let's put it to the test with some examples:

```
console.log(ASCIIToChar(65)); // Output: 'A'
console.log(ASCIIToChar(97)); // Output: 'a'
console.log(ASCIIToChar(33)); // Output: '!'

```
You can use [ASCII to text converter](https://www.fireboxtools.com/text-tools/ascii-to-string) to verify your output or convert ASCII codes to text online.


## Handling Arrays of ASCII Codes:

What if you have an array of ASCII codes that you want to convert to a string? Fear not; JavaScript has you covered. We can modify our function to handle arrays of ASCII codes:

```
const ASCIIToString = (asciiArray) => {
  return String.fromCharCode(...asciiArray);
};

```

Now, you can convert an array of ASCII codes into a string effortlessly:

```
const asciiArray = [72, 101, 108, 108, 111];
console.log(ASCIIToString(asciiArray)); // Output: 'Hello'

```

## Real-World Applications:

Understanding how to convert ASCII codes to characters opens the door to various real-world applications. You might encounter scenarios where data is encoded using ASCII and decoding it into readable text becomes a necessity

### Conclusion:

In this exploration of converting ASCII codes to characters in JavaScript, we've equipped ourselves with a fundamental skill. The ability to decode ASCII opens up numerous possibilities in programming. Whether you're working with textual data or diving into the intricacies of character encoding, mastering the conversion from ASCII codes to characters is a journey well worth taking. Happy coding!