teleren/devto huggingface dataset:
Choosing the Best Framework for Your Next Project: Django or Node.js?
Published: 2023-01-25 10:13:58

If you are a web developer looking to build a powerful, dynamic website, you may be wondering which framework is best for your project: Django or Node.js? Both frameworks offer different advantages and drawbacks depending on the type of website that you want to create. To help you decide, let's take a closer look at each technology and discuss their key features. 

## Django 

Django is an open-source Python-based web application framework that is designed to make building complex websites easier than ever before. It allows developers to quickly create sophisticated applications with minimal coding effort. This makes it an ideal choice for projects where time is of the essence and there is limited time to write code from scratch. Additionally, Django comes with plenty of features out-of-the-box such as an object-relational mapper (ORM) that makes it easy to interact with databases, an authentication system for user accounts, and a templating system for designing webpages quickly and easily. All of this adds up to make Django one of the most popular web frameworks available today. 

## Node.js
 
Node.js is a JavaScript runtime environment that enables developers to create powerful applications with less code than traditional methods require. Unlike other frameworks, Node.js does not require developers to learn a new language; instead, they can use existing JavaScript knowledge to rapidly build dynamic websites and applications with ease. Additionally, Node.js is known for its scalability thanks to its event-driven architecture; this makes it well suited for situations where multiple requests need to be handled simultaneously without any noticeable performance drops in quality. Finally, Node.js also has access to thousands of modules via NPM (Node Package Manager), which makes it easy for developers to find solutions for their projects without having to write custom code from scratch each time something new comes up.  

**Conclusion:**  Whether you choose Django or Node.js will depend on your individual needs and preferences as well as the type of project you are working on - but both frameworks offer powerful development capabilities that make them both viable options when it comes time to pick the right tool for your next project! With this information in hand, you should now have all the knowledge necessary to select the best framework for your next web [development endeavor](https://www.itsguru.com/application-development/)!
Where to store data in chrome extension ?
Tags: chromeextension, webdev, javascript, beginners
Published: 2023-01-25 10:10:40

In this post, we're going to use `chrome.storage` API to store, retrieve, and track changes to user data in the chrome extension. 

If you are building your first chrome extension than you might stumble across a problem of storing user data specific to each site. Using `chrome.storage` API is the easiest way to solve the problem and it can also help you to establish a indirect communication channel between the extensions and the content scripts.

So let's get started!

**1. To use the storage API, declare the "storage" permission in the extension manifest. For example:**

```json
 {
  "name": "My extension",
  ...
  "permissions": [
    "storage"
  ],
  ...
}
```
**2. Create a file `storage.ts` which will act as a storage utility file to keep all the methods you need to work with `chrome.storage` Api. For example:** 

 {% embed https://gist.github.com/ambujsahu81/9b524e6b4e1a911f95f4993b165be38a.js %}

The setter and getter will help you to store and retrieve user data from chrome extension local storage.

**3. Now you can import `localStorage` from storage.ts file in your extension or in your content script. For example**

```ts
  import { localStorage } from '../shared/storage';

  // To get the data from local storage use follow
  localStorage .get((userData) => {
    // do something
  })
 
  // to save the data simply use
  localStorage.set(userData); 
``` 

**Note** Think of adding to storage as being like putting something in a pipe. The pipe may have material in it already, and it may even be filled. Always assume a delay between when you add to storage and when it is actually recorded

**4. In your content script you can listen to the changes done to stored data by adding the following**

```ts
   localStorage.listen(updateDom);
```  
The listen method will need a callback function which will be called every time any changes is done to stored user data. Hence it act as communication channel between content script and the extension. you can now easily update the `dom` or trigger some content script work by updating the local storage in your extension.

You can find the complete code sample [here](https://github.com/ambujsahu81/Website-Customizer-Plus) 

**References**

- [chrome.storage](https://developer.chrome.com/docs/extensions/reference/storage/)
Deploy Conduktor & a MSK Cluster in 3 commands
Tags: aws, kafka, conduktor, tutorial
Published: 2023-01-25 09:42:08

Full blog post available at the [Compose-X Labs](https://labs.compose-x.io/kafka/conduktor_msk_demo.html)

Use ECS Compose-X and the new `x-msk_cluster` extension to create new cluster/use existing ones, and connect your ECS services to it.

### Run the demo in 3 commands

Install compose-x & the MSK extension

```bash
python3 -m pip install --user ecs-composex-msk-cluster
```

Download the compose file for the demo

```bash
wget https://raw.githubusercontent.com/compose-x/ecs_composex-msk_cluster/main/use-cases/conduktor.yaml
```

Deploy to AWS with ecs-compose-x

```bash
ecs-compose-x init && \
ecs-compose-x up -d templates -p msk-conduktor -f conduktor.yaml
```

This blog post uses [Conduktor Platform](https://conduktor.io) as the example service given it has native IAM integration to AWS MSK and allows for testing connectivity & access to the Kafka Cluster.

You can log into the Conduktor platform using the defined username and passwords (defined in `conduktor.yaml`) and connect to `http://<ecs_task_public_ip>:8080/`
How Can the Magento 2 SMTP Extension Improve Your Email Reputation
Published: 2023-01-25 09:29:41

The main purpose of the Magento 2 SMTP extension is to make the exchange of emails between store owners and customers comfortable and secure. Also, any kind of spam has to be stopped.

All email marketing campaigns in your Magento 2 store need to be controlled to know whether emails are reaching customers successfully or not. If email transfer is not handled well, your reputation may be negatively affected.

To ensure email accuracy and avoid receiving spam emails, we at Webkul offer the Magento 2 SMTP Extension to meet all your requirements and expectations. This extension increases your chances of sending reliable emails quickly from a local hosting or custom SMTP server. Plus, with the debug mode, the testing process becomes easier for all emails, giving you the right to log all sent emails and view them in detail.

### Powerful Features of Magento 2 SMTP Extension:

- Use your own SMTP server or 28+ popular servers
- Build email backlist easily
- Have full control over SMTP settings
- Make sure all customers receive your email
- Email logs with maximum control
- Check email for spam content in the blink of an eye
- Email logging with comprehensive view
- Make sure all emails are sent in debug mode
- Support multiple email senders
- Import emails easily in CSV
- Test run before sending mail
- Restrict specific IP addresses from sending SMTP email
- Powerful SMTP Email Reports
- Enjoy an amazing customer experience with us
- Faster speed with Magento block caching

### The Benefits of the Magento 2 SMTP Extension for Email Marketing:

Along with the core function of sending mail, the [Magento 2 SMTP extension](https://store.webkul.com/magento2-smtp-extension.html) provides many benefits for email marketing, such as:

**Save on email marketing expenses:**
With the SMTP server framework, sending your email to consumers will no longer be confused with spam or infected with viruses, which will help you save costs on email marketing campaigns.

**Boost email marketing delivery and production:**
The Magento 2 SMTP extension helps in increasing the number of visits, automating the delivery, and thus making your email marketing stronger.

### Conclusion:
[Magento 2 plugins](https://store.webkul.com/Magento-2.html) let you use any third-party SMTP server for your online store and make it easy to configure all the necessary settings to avoid the problem of unfamiliar senders. You can use any reliable SMTP server so that your emails can be delivered directly to your customers.
Closure in JavaScript
Tags: webdev, javascript, closure, programming
Published: 2023-01-25 09:21:07

In JavaScript, a closure is a mechanism or bundle of functions that has access to the variables in its parent scope, even after the parent function has completed executing. This allows the inner function to "remember" the values of the variables in its parent scope.

Here is an example of a closure:
`
function outerFunction(x) {
  return function innerFunction(y) {
    return x + y;
  }
}

let add5 = outerFunction(5);
console.log(add5(3)); // 8
`

In this example, the 'outerFunction' is defined and takes a single argument 'x'. It then returns a function 'innerFunction' that takes a single argument 'y'. The 'innerFunction' has access to the 'x' variable from its parent scope, even though the 'outerFunction ' has already completed executing.

When the 'add5' variable is defined, it is set to the returned value of calling 'outerFunction' with an argument of '5'. This means that 'add5' is now a reference to the 'innerFunction', with 'x' set to '5'. When 'add5' is invoked with an argument of '3', it returns '8', which is the sum of 5 and 3.

Closures are used extensively in JavaScript for a variety of purposes, such as:

**1. Creating private variables and methods
2. Creating object data privacy
3. Event handling
4. Currying
5. Creating stateful function**

Closures are one of the core concepts in JavaScript, and a good understanding of them is crucial for developing complex and maintainable JavaScript applications.
C++ da shart operatorini ichma ich ishlatish haqida
Tags: cpp, programming, beginners, coding
Published: 2023-01-25 09:16:14

Shart operatorini ichma ich ishlatishni o'rganamiz.


Bu maqolamiz unchalik ham ko'p cho'zilmaydi chunki oldingi maqolalarda ko'p turlarini ko'rib o'ttik. Va bugun ichma ich shart operatori haqida ko'rib o'tamiz. Bu maqolada ham avval dastur yozib olamiz va o'sha dastur bo'yicha tahlil qilib chiqamiz.
**Shart** shundayki biz son kiritamiz uning musbat juft son, musbat toq sonligini va manfiy juft son manfiy toq sonligini tekshirish uchun dastur yozib chiqishimiz kerak.

```cpp
#include <iostream>

using namespace std;

int main () {

int n;
cin >> n;

if(n>0){
  if(n%2==0){
    cout << "Bu musbat juft son";
  }
  else{
    cout << "Bu musbat toq son";
  }
}
  else if(n==0){
    cout << "Bu son 0 ga teng";
  }
  if(n<0) {
    if(n%2==0){
      cout << "Bu manfiy juft son";
    }
    else {
      cout << "Bu manfiy toq son";
    }
  }


return 0;
}
```

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

Mana yozilgan dasturga qarasak if(n>0) shartini bajarilsa {} qavs ichiga amal emas yana bitta if(n%2==0) sharti yoziladi. Yani avval son musbatligini tekshiradi keyin esa uni juft ekanligini tekshiradi. Agar ikki shart ham bajarilsa bu Musbat juft son deb ekranga chiqadi. 2 chi shart bajarilmasa mubat toq son chiqadi.
Manfiy son uchun ham huddi shu tartibta yozib chiqiladi yani avval manfiyligini tekshiramiz keyin uni toq va juftligini. Ohirgi jarayon esa son 0 ga teng bo'lgandagi holat. nima uchunki 0 musbat son ham emas manfiy son ham emas. 0 kiritilganda bu son 0 ga teng deb yozuv chiqadi. Buni yaxshi o'rganishimiz uchun ko'proq misollar bajarishimiz kerak va shunda yaxshi ko'nikma hosil bo'ladi. Shu bilan ichma ich shart operatorini ham yakunlaymiz.  Tursunboev Jamshidbek

@dawroun
4. Don’t limit business people's access to IT
Tags: itdepartment, itbusiness, productivity
Published: 2023-01-25 09:11:03

A highly effective technique to reduce work in an IT department is to allow business people free access to IT personnel.

__This seems counterintuitive!__

There are extraordinarily compelling reasons to allow business people access to IT personnel.

## Reason 1: IT people have a better understanding of what resources a given task requires

I repeatedly experience business people changing their initial requests to something more challenging. The only reason is that they think the modified task is easier for IT.

It is typically easier to give business people precisely what they want instead of what business people think is easy for IT to deliver.

## Reason 2: IT people need to learn to say no and have a proper approach to escalating to upper management

Some tasks are just insanely difficult and resource intensive:

 - Two-way syncing of systems.
 - Managing a new software vendor.
 - Integrating a new business model before it is fully developed.

In those circumstances, it is best if business people go directly to IT, so IT can explain why a given task would be disruptive and then, together, form a plan to achieve the same business objective without destroying IT productivity.

And if that isn't possible, business people and IT should be able together to escalate a priority to upper management.

## Reason 3: Give a much broader window when scoping a project
A harmful situation can transpire when a new project is being scoped:

Business people will ask for excessively many features. Often features that will never be used. Often features that the business knows that there is very little chance of actually being used.

People do this for one reason. They know if they don't ask for it now in the project scoping, they will never be able to get it in the future. So they over ask.

I've seen project ballooning with a factor of between 10 and 100* only due to business people's fear that they cannot change the scope later.

_*yes, I do mean a 100-hour task can explode to a 1000-hour task to even a 10000-hour mammoth project, only due to requirements that are not strictly needed by the business._

If business people know they can always come back with more requests, they won't need to over-ask at the beginning of a project.
"this" keyword in JavaScript
Tags: webdev, javascript, react, beginners
Published: 2023-01-25 09:05:46

## In Regular Function

In JavaScript, when an object method is invoked, the "this" keyword inside the method refers to the object that the method is a property of.

**For Example**
`
let obj = {
    name: "John",
    sayName: function() {
        console.log(this.name);
    }
};
obj.sayName(); // Output: "John"
`

 Here the 'sayName' method is a property of the 'obj' object, and when it's invoked, 'this' inside the method refers to 'obj', so 'this.name' evaluates to "John".


## In Arrow Function

// In JavaScript, arrow functions do not have their own "this" value. Instead, they inherit the "this" value from the surrounding scope.

**For example:**

`
let obj = {
    name: 'John',
    sayName: () => {
        console.log(this.name);
    }
};

obj.sayName(); // undefined (instead of "John")

`
In the example above, the arrow function 'sayName' is a method of the 'obj' object. However, because the arrow function does not have its own "this" value, it inherits the "this" value from the global scope, which is undefined instead of the 'obj' object.

This can be overcome by using the bind() method to explicitly bind the this value to the object
`

let obj1 = {
    name: 'John',
    sayName: function () {
        console.log(this.name);
    }
};

let arrowSayName = obj1.sayName.bind(obj1);
arrowSayName()// 'John'
`


It's important to note that the value of "this" can be reassigned using bind, call, or apply methods or if the method is passed as a callback function and invoked in a different context.

In addition, when a constructor function is used to create an object, the "this" keyword inside the constructor function refers to the new object that is being created.

'this' is a powerful tool in javascript to access the context of the function, but it can be tricky to understand and use it correctly, and it's important to keep in mind the context of the function and how it is invoked to avoid unexpected results.


**It's important to understand the behavior of this keyword when it comes to arrow functions because it can lead to unexpected results and bugs in your code if you're not careful.**
💜 Markdown editor
Tags: markdown, note, md
Published: 2023-01-25 08:44:19

# Quale scegliere?!

### "Non esiste il prodotto perfetto ma solo quello che soddisfa le proprie necessità."


---

# What I evaluated:

- Zettlr
- Obsidian
- Marktext
- Joplin
- Logseq
- Tangent
- Simplenote

---

### 🧘‍♀️ [Zettlr](https://www.zettlr.com/)

✅ Open Source
✅ Support per le immagini
✅ Snippet
✅ Personalizzazione
❌ Non nasconde la formattazione mark-down (es. ** **)

---

### 🕺 [Obsidian](https://obsidian.md/)

✅ Well done
✅ Plug-in
✅ Community
✅ Mobile
❌ Gestione agnostica dei file

---

### 🤸‍♀️ [Marktext](https://github.com/marktext/marktext)

✅ Gestione agnostica dei file 
❌ Personalizzazione

---

### 🏌️ [Joplin](https://joplinapp.org/)

✅ Open Source
❌ Gestione agnostica dei file 

---

### 🏌️ [Logseq](https://logseq.com)

✅ Well done
✅ Open Source
✅ Privacy first
❌ Gestione agnostica dei file 

---

### 🏌️ [Tangent](https://tangentnotes.com)

✅ Gestione agnostica dei file
❌ Non formatta i task-list

---

### 🏌️ [Simplenote](https://simplenote.com/)

❌ Gestione agnostica dei file
❌ Gestione locale delle immagini
SwiftLint regex help
Tags: regex
Published: 2023-01-25 08:33:52

regex: '^(?!override).*(var|let)\s((?!is)(\S)+)(((\s*Bool)(\?|\!)?)|\s(=\s(true|false))){1,2}(\s\{)?$'

name: "Boolean property declaration"
message: "Boolean type must start with 'is'"

this is a linter rule we came up with. 
is tries to enforce Booleans being declared in our convention of always starting with the word 'is'
example: 

let myVar: Bool
- wrong, booleans must begin with 'is'

let isMyVar: Bool
- good

let myVar2 = true
- wrong, must start with is

override var myVar: Bool
- good, since we ignore 'overrides'

'override' can appear in between other modifier words of the lang, like so:

public static override var enabled: Bool 
-or-
override fileprivate var myVar: Bool

when we enable the rule with our regex expression, it makes the linter slow and sluggish.
we are no regex experts by any means - BUT YOU GUYS ARE!
help us make this expression more efficient.

our needs are as follows:

1. the word 'overrride' must not appear. it might or might not appear as one of the words at the beginning. and always before 'var' or 'let'

2. the words 'var' or 'let' must be present

3. the word which comes up after 'var' or 'let' must not contain the word 'is' (this is the essence of this rule)
this word is in fact the variable name.

4. right after the variable name we might have a type declaration like so:

private var myVar: Bool
private var myVar:Bool
private var myVar:  Bool

or we have an immediate assignment with `= false` or `= true`:

private var myVar = true
private var myVar=true
private var myVar = false

appreciate your help!
AWS Cloud Quest: Auto-Healing and Scaling Applications Study Note
Tags: aws, cloud
Published: 2023-01-25 08:28:22

This is the DIY challenge of the Auto-Healing and Scaling Applications task in AWS Cloud Quest.

### DIY Steps:
1. Create scheduled action under Auto Scaling groups `RegularCustomerGameServer`

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyypc5h1qkbswwf53z9o.png)
Finding Opportunities When Life Drags You Under
Tags: hope, opportunities, networking, layoffs
Published: 2023-01-25 08:20:16


"**The Profit Is In The Problem.**" Who said that? I don't know. But you would like to note it down.

Life can be challenging at times. Whether it's a job loss, a relationship ending, or a health scare. Difficult situations are an inevitable part of life. But as hard as they can be to deal with, these situations can also be opportunities for growth and learning.

One of the critical things to remember when facing a difficult situation is to **reframe your perspective**. Instead of seeing it as a negative experience, try to see it as a chance for growth and development. This shift in mindset can make all the difference in how you approach the situation. It's an essential strategy to look for the silver linings. Even in the darkest of times, there are often small things to be grateful for. Whether it's a supportive friend, a sunny day, or a good book, these positive aspects can help to keep you going.

It's also essential to **identify your strengths and resources**. What are you good at? What do you have to offer? These things can help you find opportunities in your current situation. For instance, **Networking** is a great way to find opportunities. Reach out to your friends, family, and professional contacts. They may have resources or connections that can help you find opportunities.

Giving back to your community can often be a great way to make a difference, even when things are tough. Individuals like me, consider it a way to find meaning and purpose in difficult times.

Finally, I'd like you to **remain open to new opportunities**. Sometimes, the best opportunities come from unexpected places. So be adaptable, and be open to new experiences. One of the great examples that demonstrate the combination of all the points I am sharing with you can be seen here - https://www.linkedin.com/posts/ferid-sabanovic-35bb282_opportunity-team-digital-activity-7021505642829926400-86O-?utm_source=share&utm_medium=member_desktop

Remember, finding opportunities in difficult times can take time, and progress may be slow. Be patient with yourself, and don't give up hope.
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes, watercooler
Published: 2023-01-25 08:00:15

---
title: "Today's Daily Dose of Programming Humor"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes, #watercooler
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258ca137e1.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why was the computer freezing?

___A:___ It left its Windows open!
 -->