teleren/devto huggingface dataset:
SRE book notes: Postmortem Culture
Tags: sre, books, postmortem
Published: 2023-02-01 09:10:53

These are the notes from [Chapter 15: Postmortem Culture: Learning from Failure](https://sre.google/sre-book/postmortem-culture/) from the book [Site Reliability Engineering, How Google Runs Production Systems](https://sre.google/sre-book/table-of-contents/).

This is a post of a series. The previous post can be seen here:

{% embed https://dev.to/bitmaybewise/sre-book-notes-managing-incidents-158d %}

---

> Unless we have some formalized process of learning from these incidents in place, they may recur ad infinitum. Left unchecked, incidents can multiply in complexity or even cascade, overwhelming a system and its operators and ultimately impacting our users.

---

> It is important to define postmortem criteria before an incident occurs so that everyone knows when a postmortem is necessary.

---

> A blamelessly written postmortem assumes that everyone involved in an incident had good intentions and did the right thing with the information they had. If a culture of finger pointing and shaming individuals or teams for doing the "wrong" thing prevails, people will not bring issues to light for fear of punishment.

---

> You can’t "fix" people, but you can fix systems and processes to better support people making the right choices when designing and maintaining complex systems.

---

> Avoid Blame and Keep It Constructive

> No Postmortem Left Unreviewed

---

If you liked this post, consider subscribing to my newsletter [Bit Maybe Wise](http://bitmaybewise.com/).

You can also follow me on [Twitter](https://twitter.com/bitmaybewise) and [Mastodon](https://mastodon.online/@bitmaybewise).


---

Photo by [Kenny Eliason](https://unsplash.com/@neonbrand) on Unsplash
How to delete an element from map - JavaScript
Tags: javascript, webdev, beginners, programming
Published: 2023-02-01 09:05:31

In this article we will learn how to delete an element from map.

It is very common to delete an element from map in JavaScript.

***

## Problem

Now we have a problem, which is that we want to delete an element from the map.

Now let's define a map like this:

```javascript
// Map
const map = new Map([
    ['name', 'John'],
    ['age', 30],
]);

console.log(map);
// Map(2) { 'name' => 'John', 'age' => 30 }
```

And we only want to delete an element from our map, so the output becomes like this:

```javascript
Map(1) { 'age' => 30 }
```

*If we deleted name element*

**How to solve this problem?**

Fortunately, there is already a function in the map that deletes items call `delete()`, all you have to do is use the `delete()` function, and pass the item you want to delete.

***

## Delete an element using `delete` method

As we said before you can use `delete()` method to remove an element from map.

**Example**

```javascript
// Map
const map = new Map([
    ['name', 'John'],
    ['age', 30]
]);

// Print before deleting
console.log(map);

// Delete element
map.delete('name');

// Print after deleting
console.log(map);
```

**Output**

```javascript
Map(2) { 'name' => 'John', 'age' => 30 }
Map(1) { 'age' => 30 }
```

**Well, now what if I want to delete the first element and I don't know its key! What do I do?**

## Delete the first element of map

Now I will answer the previous question, if you want to delete the first element and you don't know its key.

You can use `Array.from()` to get all the element in an array and then you can get first element easily.

```javascript
// Map
const map = new Map([
    ['name', 'John'],
    ['age', 30]
]);

// Array with elements
const array = Array.from(map);

// First element
const firstEle = array[0];

// Print
console.log(firstEle);
```

Now that we get the first element, we can delete it using `delete`.

```javascript
// Map
const map = new Map([
    ['name', 'John'],
    ['age', 30]
]);

// Array with elements
const array = Array.from(map);

// First element
const firstEle = array[0];

// Delete first element by his key `[0]`
map.delete(firstEle[0]);

// Print
console.log(map);
```

**Output**

```javascript
Map(1) { 'age' => 30 }
```

***

## Thank you for reading

Thank you for reading my blog. 🚀 You can find more on [my blog](https://mo-ibra.com/) and connect on [Twitter](https://twitter.com/MoIbrraa)
SQL: The Heart of Data Management
Published: 2023-02-01 09:00:46

SQL, or Structured Query Language, is the lifeblood of any database. It’s the language used to manage and manipulate the data stored in databases. Whether you’re working with a small database for a personal project or a massive data warehouse for a corporation, SQL is the tool you need to bring order to the chaos of data.

In this blog, we’ll explore the basics of SQL and how it can be used to make sense of your data. From simple queries to relationships and aggregators, we’ll cover everything you need to know to get started.

**Getting Started with Simple Queries**

The first step in using SQL is learning how to write simple queries. A query is a request for information from a database. To write a query, you use the SELECT statement followed by the columns you want to retrieve. For example, if you have a database of customers, you might write a query like this:


```
SELECT first_name, last_name, email 
FROM customers;
```
 
This query returns the first name, last name, and email of all customers in the database.

**Building Relationships**

Databases are more powerful when they contain multiple tables, each representing a different type of data. To relate these tables to each other, you use the JOIN statement. This allows you to combine data from multiple tables into a single result set.

For example, let’s say you have a database with two tables: customers and orders. You can write a query to see the first name, last name, and order date of all customers who have made an order:

```
SELECT first_name, last_name, order_date 
FROM customers 
JOIN orders 
ON customers.customer_id = orders.customer_id; 
```

**Aggregators: Bringing Data Together**

Once you have your data organized, you can start to summarize it with aggregators. Aggregators are functions that perform calculations on data, such as counting, summing, and averaging. For example, you can use the COUNT function to find out how many customers you have:


```
SELECT COUNT(*) FROM customers; 
```
Or, you can use the SUM function to find out the total sales for the month:

```
SELECT SUM(total_sales) 
FROM orders 
WHERE order_date BETWEEN '2022-01-01' AND '2022-01-31'; 
```


**Bringing it All Together**

SQL is an incredibly powerful tool for managing data, and these are just the basics. Whether you’re working with a small database or a massive data warehouse, SQL is the key to unlocking the value of your data. By using simple queries, relationships, and aggregators, you can turn your data into actionable insights. So get started today and see what SQL can do for you!
Kali Linux is a popular operating system used for various purposes, including:
Tags: linux, programming, beginners, webdev
Published: 2023-02-01 08:55:34

**Penetration Testing**: Kali Linux is equipped with a vast array of tools for conducting ethical hacking and penetration testing. It can be used to test the security of a network, web applications, and systems.

**Digital Forensics**: Kali Linux can be used for digital forensics investigations, which involves the recovery and analysis of data from digital devices.

**Cybersecurity Training**: It is a great platform for students and professionals to learn and practice cybersecurity skills.

**Software Development**: Kali Linux supports programming languages such as Python, Perl, Ruby, and others, making it a suitable platform for software development.

**Wireless Network Testing**: Kali Linux provides a suite of tools for analyzing and testing wireless networks.

**Web App Security Testing**: Kali Linux is equipped with tools for testing and exploiting vulnerabilities in web applications.

**Reverse Engineering**: It is used for reverse engineering and analysis of malware, software, and firmware.

**Note**: Kali Linux should only be used for legal and ethical purposes. The tools provided in Kali Linux can be used to perform malicious activities, which is illegal.
OKX Chain Develper Focus Group
Tags: blockchain, web3, community
Published: 2023-02-01 08:39:32

Hello there!

OKX Chain is conducting a focus group with Blockchain and Web3 Developers to find out more about what developers are looking for when considering a chain to build on. We are mostly curious on what developers want and what we as a chain can do to serve them better. 

The meeting will likely take place over zoom with 5-6 developers some time from 13-17 Feb 2023. 


We are looking for:
- Developers and builders working in the blockchain space
- Individuals with experience of building and deploying blockchain-based applications

Sign up through this [link](https://docs.google.com/forms/d/e/1FAIpQLSdkRAl0J5v1TwSmIM66UDMEyHB8-3OIOj3TTQ8rH7hW6hxxcw/viewform?usp=sf_link) to be considered and someone from OKX Chain will reach out to you. Only confirmed participants will be contacted. 

Interviewees will receive a small token of $20 in USDT, so do indicate your wallet addresses in the form! 

About OKX Chain

OKX Chain is an EVM-compatible L1 built on Cosmos with a focus on true interoperability (IBC) and maximized performance. At high scalability, developers can build and scale with low gas fees. The OKC ecosystem and infrastructure, including the all-in-one multi-chain Web3 interface, enables a seamless experience for both developers and users.

Find out more [here ](http://okx.com/okc)
Javascript Spread Operator
Tags: javascript, beginners, react, codenewbie
Published: 2023-02-01 08:29:41

Spread Operators in JavaScript: Simplifying Array and Object Manipulation

JavaScript is a powerful and versatile programming language, and the spread operator is one of its most useful features. The spread operator allows developers to easily expand arrays and objects, and manipulate them in ways that would otherwise be difficult or impossible. In this blog post, we will take a deep dive into the world of spread operators in JavaScript.

What is a Spread Operator?
A spread operator is a set of three dots (...) that can be used to spread or unpack elements from an array or an object. The spread operator is incredibly useful for a variety of tasks, such as copying arrays and objects, merging arrays, and more.

Expanding Arrays with the Spread Operator
One of the most common use cases for the spread operator is to expand arrays. This allows you to combine two or more arrays into a single array. For example, consider the following code:

javascript
Copy code

```
const array1 = [1, 2, 3];
const array2 = [4, 5, 6];
const combinedArray = [...array1, ...array2];
console.log(combinedArray); // [1, 2, 3, 4, 5, 6]
```

In this code, we are using the spread operator to combine array1 and array2 into a single array called combinedArray. The spread operator unpacks each element from each array and places them into the new array.

Expanding Objects with the Spread Operator
The spread operator can also be used to expand objects. When used on an object, the spread operator will unpack the properties of the object and create a new object with the same properties. For example:

```
const obj1 = {a: 1, b: 2};
const obj2 = {c: 3, d: 4};
const combinedObj = {...obj1, ...obj2};
console.log(combinedObj); // {a: 1, b: 2, c: 3, d: 4}
```

In this code, we are using the spread operator to combine obj1 and obj2 into a single object called combinedObj. The spread operator unpacks each property from each object and places them into the new object.

Conclusion
The spread operator is a simple but powerful tool in JavaScript that makes it easier to manipulate arrays and objects. Whether you're merging arrays, copying objects, or creating new objects with specific properties, the spread operator makes your life as a developer much easier. By incorporating the spread operator into your coding practices, you'll be able to write more efficient, readable, and maintainable code.
How to host Django Project on Vercel
Tags: django, webdev, beginners, programming
Published: 2023-02-01 08:04:14

- In settings.py, set ALLOWED_HOSTS=[".vercel.app"]
- add a file in same directory as manage.py called ``vercel.json`` and in the file write the code: <pre>``{
    "builds": [{
        "src" : "django_project/wsgi.py",
        "use" : "@vercel/python",
        "config" : {"maxLambdaSize": "15mb", "runtime" : "python3.9"}
    }],
    "routes": [
        {
            "src" : "/(.*)",
            "dest": "django_project/wsgi.py"
        }
    ]
}``</pre>

NOTE: * replace django_project in the code with the name of your project * If you use the name of app instead, it will not work.

- Navigate to your project folder and open file called wsgi.py, add line <pre>
app = application
</pre> at the bottom of the file.

- run command ``pip freeze > requirements.txt`` Make sure requirements.txt file is created in the same directory as the manage.py.

- run ``git add``, ``git commit``, and ``git push`` commands to push the code to github.

- create a vercel account and import your repository on vercel from github and that's just it.

Follow For More!!
SEO with Nuxt 3
Tags: webdev, javascript, beginners, programming
Published: 2023-02-01 08:02:36

{% embed https://www.youtube.com/watch?v=PpyXtoM5HWQ&ab_channel=CodewithGuillaume %}

Search Engine Optimization (SEO) is an essential aspect of website development, and Nuxt 3 provides several features that make it easier to optimize your site for search engines. Nuxt 3 is a popular JavaScript framework for building server-rendered Vue.js applications, and it includes several built-in features that help improve your site's SEO.

One of the most significant benefits of Nuxt 3 for SEO is its automatic generation of static HTML files for each page of your site. Search engines can easily crawl and index static HTML files, making it easier for them to understand the content of your site and rank it higher in search results.

Another way that Nuxt 3 helps with SEO is through its built-in support for metadata. Metadata provides information about your site's content to search engines, such as the title and description that appear in search results. In Nuxt 3, you can specify metadata for each page of your site in the page's component file, which makes it easy to provide relevant information to search engines.

Nuxt 3 also makes it simple to add structured data to your site. Structured data is a standardized format for providing information about your site's content to search engines. Adding structured data to your site can help improve your search engine rankings and provide rich snippets in search results, which can increase click-through rates.

Additionally, Nuxt 3 provides a pre-rendering feature, which generates static HTML files for your site before it is loaded. This means that your site's content is available to search engines almost immediately, which can help improve your site's search engine rankings.

In conclusion, Nuxt 3 is a powerful tool for SEO. Its built-in features, such as automatic generation of static HTML files, support for metadata, and pre-rendering, make it easier to optimize your site for search engines. Whether you're a beginner or an experienced developer, Nuxt 3 provides the tools you need to improve your site's SEO.

Guillaume Duhan
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2023-02-01 08:00:25

---
title: "A Nice Developer Joke For Today"
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
---

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/5e1259ab8700f.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 nobody given food at the developer conference?

___A___: It was a serverless function!
 -->
The Current Market Cycle's Best Bet For Traders Is Solana (SOL) - Here's Why
Tags: solana
Published: 2023-02-01 07:54:41

The price of Solana has primarily increased since the start of the year. But as of this writing, it has decreased and is currently in the red. However, market observers have widely projected the token's potential.

Experts Predict Massive Growth for SOL
A chart comparing the current price movement of Solana to that of Ethereum in 2018 was recently uploaded with his audience by Cantering Clark, a pseudonymous trader with 159,000 followers on Twitter.

The trader's chart demonstrates how both assets broke through a support level after repeatedly tapping it, produced a lower bottom, and then rebounded. At the conclusion of the year, Ethereum's price had increased by 5,777% from its 2018 low of $83 to its all-time high of $4,878. A recovery to roughly $462 is anticipated, based on SOL's most recent closing of $8.50 and the prediction of a similar decrease before to the next bear market.
Bankless Podcast, Chris Burniske, a co-founder of Placeholder VC, stated that even if Ethereum is now a more resilient asset, Solana is on the correct route to harden its asset and will keep doing so.

Therefore, with regular purchases, this cryptocurrency may rise another 10% and attempt to breach the $30 threshold. If Solana is successful in navigating the crypto-difficulties verse's while resolving the consensus problems. According to coinpedia, the [SOL price](https://coinpedia.org/price-prediction/solana-sol-price-prediction/) might rise to $36.87.
Inverse of hasManyThrough Laravel
Tags: laravel, php
Published: 2023-02-01 07:26:38

Currently, I'm developing a Learning Management System called [Kelas Design](https://kelasdesign.my/). And today my task is to count how many Episodes do the Series have and vice-versa.

So I do the logic using Laravel Built-in Eloquent : Has Many Though. What's my logic look like is :


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



So I will get the Episodes data through Section. That's fine. But how about getting the Episode and which Series it's belongs to?

I realized that, in Laravel documentation, there's no instruction about Inverse of Has Many Through or Has One Through.

And since they don't provide that instruction, so I do need to create it manually. Usually if I faced a situation like this, I always reverse engineer the logic.

For example, Laravel has the built-in function such as Has Many Through & Has One Through.

So what I do is in Episode Model, I create method and returning Has One Through.  If you're thinking about using belongsTo, you are wrong.

And this is my logic :


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



By default, you can just passed two (2) arguements if you are following Laravel convention. But in my case, If you just passed the two arguements, it will print an Error. Which the system cannot find the column you wanted.

With the extra arguements, you can search more depth. The third arguement is called `$first_key` and the fourth is `$second_key`.

Adding this, will allow the system to search more deep in your Database. And Eventually, will return you a data that you need. The third and fourth arguements is not nessasary an 'id'. It can be something else.

That's all, I hope my solution also can solve your situation like me also. If you have a better approach to do the inverse, please do comment below :)

PS : I've stumble upon one package name `staudenmeir/belongs-to-through`. Tested it and based on what I read at the files, this package also will solve my problem. However, I do not seek something overkill like this. Look at my solution, compared to this package. Even though the syntax is much cleaner, but I still need to download the package that have many files. And that I do not want to.

By the time I wrote this blog, this package has issue. Please refer to [Github Issue](https://github.com/staudenmeir/belongs-to-through/issues/75)
JS game engine update, Kaboom 3000 beta released
Tags: javascript, kaboom, gameengine, gamedev
Published: 2023-02-01 07:10:08

The Kaboom game engine received an update and has reached it's third major version **Kaboom 3000**. 

- object scene graph / children objects 
- rotated / polygon areas
- load .ttf, .otf, .woff fonts
- up to 50x graphics performance
- custom loading screen
- post visual effects
- tweening!!!!
- gamepads
- pathfinding

That's a pretty hefty and ambitious feature set for a relatively small project like this. On the one hand, it's not Unity... but on the other hand, good.

The docs are great and the Discord is active. If you're a front end or full stack JS dev by day, Kaboom is a legit way to build that dream game, or just join a [#gamejam](https://dev.to/t/gamejam) without having to learn a new language or IDE/UI. 

Details, code snippets, _and the online playground_, on the full blog post.

**[Kaboom v3000 Beta Release](https://3000.kaboomjs.com/blog/3000)**

Lastly,
I dunno. 3000 seems low. It just doesn't sound that promising or featureful. Now consider, and hear me out on this, I think  __3001__ sounds sensationally phenomenal. I'll bet it can handle anything. That **1** makes aaall the difference.
Need help to recover LinkedIn account from restriction !!
Tags: linkedin
Published: 2023-02-01 07:07:08

Hello there ! Its my first post so let me introduce myself.

I am a technical recruiter & its been few months I have started working remotely for a Filipino company. I took the risk to leave my on-site job and grab this opportunity not knowing how I will do in global recruitment. I just used to source local talents but now as I am doing global sourcing so its a bit challenging.

For sourcing LinkedIn is one of the best platforms & I have more than 22K connections. Recently because of some internal issue of my company with another company, all of our recruiters account got permanently restricted due to red flagged by the other company. They are trying to sabotage our recruitment process.

I tried to reach LinkedIn via several ways but always getting the same automated mail that due to violation of their terms & policy the account got restricted. Its not possible that all the recruiters have violated the terms on the same day & got banned !!

Can anyone help me out to reach any contact person of LinkedIn or any other way to get my account back?