teleren/devto huggingface dataset:
4 extraordinary traits of an amazing manager
Tags: manager, productivity, managing, good
Published: 2021-06-13 03:35:01

## Good communicator
A good manager will be able to keep tabs on each team members interests & career aspirations.

Communication ultimately is the key to a successful and high-functioning team. Managers being in a position of power (per se) is able to influence team dynamics and processes by using their voice for the power of good.

![Manager managing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fb5wtkpkqq58ocney7we.png)

## Will not micromanage
A good manager will always have a backbone of trust within the team dynamics.

Micromanagement will reduce employee confidence & independence. It will cost also business with the loss of individual minutes that could have been more productively spent.

![Great manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oo3jxrzzy9uce7p9tx65.png)

## Does not play favorites
Teams typically are compromised of individuals with differing strengths.

From a business perspective there may be some pressure on rapid iteration, but your interests as a manager should not be isolated to business interests.
Your team is your responsibility, their sanity & personal development are in your hands to a degree, if team members #1 has an interest in an area that team member #2 is exceptional in, you still should put in the time and effort to further team member's #1 skills.

## Good managers show empathy
Being a good manager means being able to resolve conflicts, deal with stress, understanding & relating to the emotions of others, and much more.

---

# It's just a prank, bro.
_Something that is posted online that has agreeable and/or relatable words makes it valid, right?_

The amount of dev.to and Medium posts stating "_N ways to be a good manager_", that proceed to describe traits that boil down to: **treat the people in your team as human beings** is just crazy.

Managers that manage to manage in the interest of both their people & the business praise-worthy. 

Communication (including empathy), organisational skills, personal development, not taking credit, ability to communicate are all part of the expectation & duties for a manager.
What should be the baseline is now being labelled as "great"?
Save your Django models using update_fields for better performance
Tags: django, python
Published: 2021-06-13 03:11:57

The Django ORM is designed to turn the rows of your database tables into objects that can then conform to object oriented principles. This makes it very easy to create, update and delete entries from your database.

However, there are certain advantages to using raw queries instead of an ORM. For instance when you update a row in your table, you might want to update only a subset of the columns in that row and not all of the columns.

Saving a Django model object updates all your columns every single time you call a save() method. To prevent this from happening you must be explicit.

### What save() does internally

Consider a Django model called Record which has the following fields:

```
from django.db import models

class Record(models.Model):
  # id will be created automatically
  name = models.CharField(max_length=255)
  created_at = models.DateTimeField(auto_now_add=True)
  is_deleted = models.BooleanField(default=False)
```

If you would like to update the name of a record you might do something like this

```
>>> record = Record.objects.get(id=1)
>>> record.name = "new record name"
>>> record.save()
```

If you turn on logs in the underlying database that you are using which in my case is Postgres, the query that actually runs is this:

```
UPDATE "record"
SET    "name" = 'new record name',
       "created_at" = '2021-06-12T15:09:05.019020+00:00' :: timestamptz,
       "is_deleted" = FALSE
WHERE  ""id" = 1 
```

This may not seem like a big deal, but what if your model consisted of 20 fields and you run a save() operation on it very frequently? 

At a certain scale the database query that updates all of your columns every time you call save() can start causing you some unnecessary overhead. 

Why is the overhead unnecessary? Because it can be prevented with a simple tweak.

### Use update_fields in save()

If you would like to explicitly mention only those columns that you want to be updated, you can do so using the update\_fields parameter while calling the save() method.

```
>>> record = Record.objects.get(id=1)
>>> record.name = "new record name"
>>> record.save(update_fields=['name'])
```

The underlying query now becomes

```
UPDATE "record"
SET    "name" = 'new record name'
WHERE  "record"."id" = 1 
```

You can also choose to update multiple columns by passing more field names in the update\_fields list. 

This is clearly a more efficient way to run your queries and will save you some database overhead.

### TL;DR

If you use the save() method with the intention of updating some specific columns in your database row, explicitly mention those fields by using the update\_fields parameter and calling the save() method like this:

**obj.save(update\_fields=\['field\_1', 'field\_2'\])** as opposed to just **obj.save()**

This will save you some database overhead by making the underlying query more efficient.
Top courses to learn MERN.
Tags: javascript, webdev, react, codenewbie
Published: 2021-06-13 02:45:57

MERN stands for:
- MongoDB -> NoSQL Database
- Express.js -> Web Framework for Node
- React.js -> JavaScript Library For UI
- Node.js -> Runtime environment to execute JavaScript.

Paid Courses:

- https://www.udemy.com/course/mern-stack-front-to-back/
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vqv4m2shfxohht98vit.png)

- https://www.udemy.com/course/react-nodejs-express-mongodb-the-mern-fullstack-guide/
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stnqo319t3lp82cpwlah.png)

- https://www.coursera.org/specializations/full-stack-react
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yf4vy7prju6tud41c7f1.png)

- https://www.pluralsight.com/courses/react-express-full-stack-app-building
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/byc339ksag7m7s714oek.png)
  

Free:

- https://www.youtube.com/watch?v=7CqJlxBYj-M
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xl476y3ntngmmjfa5xw9.png)

- https://www.youtube.com/playlist?list=PLillGF-RfqbbiTGgA77tGO426V3hRF9iE
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aazb8fuorqbpo3ztu25y.png)
S3 Same-Region Replication (SRR) vs Cross-Region Replication (CRR)
Tags: aws, s3, replication, security
Published: 2021-06-13 02:34:07

**Overview**

* This document is to evaluate and provide guidance on the benefits/feature of Amazon S3’s SRR and CRR replication strategy.

* Replication enables automatic, asynchronous copying of objects across Amazon S3 buckets. Buckets that are configured for object replication can be owned by the same AWS account or by different accounts.

* Replication can be achieved within the same AWS Region or different AWS Region.

**Use Cases**

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

**Same-Region Replication (SRR)**

* Automatically replicates data between buckets within the same AWS Region.
* Replication can be setup at a bucket level, a shared prefix level, or an object level using S3 object tags.
* SRR can be use to make a second copy of data in the same AWS Region.
* Helps to address data sovereignty and compliance requirements by keeping a copy of your data in a separate AWS account in the same region as the original.
* Allows to change account ownership for the replicated objects to protect data from accidental deletion.
* Allows to aggregate logs from different S3 buckets for in-region processing, or to configure live replication between test and development environment.

*Observations*

* Both source and target buckets must be version enabled.
* Object deletions are not replicated to target bucket (so it’s not like rsync — delete).

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

**Cross-Region Replication (CRR)**

* Automatically replicates data between buckets across different AWS Regions.
* Provides ability to replicate data at a bucket level, a shared prefix level, or an object level using S3 object tags.
* CRR provide lower-latency data access in different geographic regions.
* CRR can help with compliance requirement to store copies of data hundreds of miles apart.
* Allows to change account ownership for the replicated objects to protect data from accidental deletion.

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

**Security**

* Objects are remained encrypted throughout the replication process.
* The encrypted objects are transmitted securely via SSL within the same region (if using SRR) or from the source region to the destination region (if using CRR).

**Pricing for S3 Replication**

* For CRR and SRR, Amazon S3 charges for storage in the selected destination S3 storage class, in addition to the storage charges for the primary copy, and replication PUT requests.
* For CRR, you will be charge for inter-region Data Transfer OUT from Amazon S3 to your destination region.
* Pricing for the replicated copy of storage is based on the destination AWS Region, while pricing for requests and inter-region data transfers are based on the source AWS Region.


**Read More**

[https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html]
Storing python objects inside PysonDB
Tags: python, database, objects
Published: 2021-06-13 02:14:27

Let's see how we can store python objects, this include strings, list, function, etc.., inside a DB like [pysonDB](https://pypi.org/project/pysondb/)

Consider I've function `foo` which takes an argument `x` and return `x * (x + x)`. Which I want to store inside a DB.

```python
def foo(x: float) -> float:
    return x * (x + x)
```

First things first we nee to convert this object to byte string. To do that we can use the `pickle`. module.

```python
import pickle
byte_string = pickle.dumps(foo)
```

This byte string cannot be directly added to a PysonDB database, as byte strings are not JSON serializable. So a simple workaround will be to add quotes around the byte string which can be easily done like this.

```python
obj_string = f"{byte_string}"
```

This string can be now added to the DB

```python
from pysondb import db

a = db.getDb("test.json")
a.add({
    "name": "foo_function",
    "obj": obj_string
})
```

To get the object back we can do the following steps.

```python
data = a.getBy({"name": "foo_function"})
```

Now `data` will look something like this.

```python
[{'name': 'foo_function', 'obj': "b'\\x80\\x04\\x95\\x14\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x8c\\x08__main__\\x94\\x8c\\x03foo\\x94\\x93\\x94.'", 'id': 316182400052721056}]
```

To convert the obj string back to a callable function. We can do the following.

```python
str_obj = data[0]["obj"]
```
Remember that  `str_obj` is still a string and not a byte string, which is what we need, since the required byte string is inside this string, we can simply evaluate the string.

```python
import ast
byte_obj = ast.literal_eval(str_obj) 
```

To call the function we can do this.
```python
call_obj = pickle.loads(byte_obj)
print(call_obj(3))

# output
18
```

## Entire Code
```python
import ast
import pickle

from pysondb import db

def foo(x: float) -> float:
    return x * (x + x)

byte_string = pickle.dumps(foo)
obj_string = f"{byte_string}"

a = db.getDb("test2.json")
a.add({
    "name": "foo_function",
    "obj": obj_string
})

data = a.getBy({"name": "foo_function"})

str_obj = data[0]["obj"]
byte_obj = ast.literal_eval(str_obj)

call_obj = pickle.loads(byte_obj)
print(call_obj(3))

```

So we have successfully stored a python object inside a DB. The steps are the same for all the objects like list or dict.
Web scraping with Python and AWS Lambda: A modern approach
Tags: aws, lambda, webscrapping, selenium
Published: 2021-06-13 01:34:56

In December 2020, AWS started to support [Lambda functions as container images](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/), which is a real breakdown that allows us to deploy way more complex projects with the same you-pay-only-for-what-you-use pricing and serverless architecture.

Web scraping workloads have real benefits from this Upgrade due to an easier installation of `selenium`. 

## Let's code!

The Dockerfile bellow is based on the oficial lambda container image for python 3.8 (it is really awful to create this image from [scratch](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-create-from-alt)).

```dockerfile
# Dockerfile
FROM public.ecr.aws/lambda/python:3.8

RUN yum install -y \
    Xvfb \
    wget \
    unzip

# Install google-chrome-stable
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm && \
    yum localinstall -y google-chrome-stable_current_x86_64.rpm

# Install chromedriver
RUN wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip && \
    unzip chromedriver_linux64.zip && \
    chmod 775 chromedriver

# Install selenium
RUN pip3 install -U pip selenium

# Copy lambda's main script
COPY app.py .

CMD ["app.lambda_handler"]
``` 

The python script below configures the Selenium with a Chrome headless. Note the path of the chrome driver at the driver definition - such path comes from the work directory of the base image.

```python
# app.py

from selenium import webdriver
chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument("--headless")
chromeOptions.add_argument("--remote-debugging-port=9222")
chromeOptions.add_argument('--no-sandbox')
driver = webdriver.Chrome('/var/task/chromedriver',chrome_options=chromeOptions)

def lambda_handler(event, context):
    driver.get("http://www.python.org")
    return {
        "statusCode": 200,
        "body": driver.title
    }
```

Finally, build and run the container image!

```bash
$ docker build -t scrapper:latest .
```

```bash
$ docker run -p 9000:8080  scrapper:latest
```

In order to [test](https://docs.aws.amazon.com/lambda/latest/dg/images-test.html) your new web scraping containerized lambda function, run the following command.

```bash
$ curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'

{"statusCode": 200, "body": "Welcome to Python.org"}
```
WWDC21 Is over, let the learning begin
Tags: wwdc
Published: 2021-06-17 06:16:17

---
title: WWDC21 Is over, let the learning begin
published: true
date: 2021-06-13 00:59:50 UTC
tags: WWDC
canonical_url: https://peterwitham.com/wwdc21-journal
---

There was far more to take in that it might first have appeared this year at WWDC. To me, it feels very much like a "Bug+" year. Lots of fixes to existing features with more additions to the core.

I was hoping this would be the case. I like alternate years to be more about keeping a solid base than iterating big things over the top, causing more problems and developers to scramble ready for the final OS releases in the Fall.

But don't let this year fool you. For example, being able to build SwiftUI based apps on the iPad and ship them to the store is a massive deal for the future and a clear indicator that Apple is taking the idea seriously.

On top of that, we got the first introduction to a new Cloud build system, which is probably the result of Apple's acquisition of Buddy Build.

We also got significant changes to the weather app on iOS, which might sound odd to highlight, but remember this comes from another purchase Apple made. What is strange about this one is that there appears to be no improved APIs for 3rd party developers to improve their weather apps.

Xcode 13 has some nice changes that will aid in the writing of Swift, any improvement year on year for Swift in Xcode is a good thing. Especially given that Apple indicates that they intend new APIs to be Swift-based rather than Objective-C.

The Swift language is always slightly depreciated when it comes to announcements at WWDC since it now has its release cycle due to the open-source project.

It is time to sit back, catch up on videos of interest and see what may affect anything I am or plan to work on between now and the Fall releases.
First Post-Grad Application: Watch Next
Tags: react, javascript, devjournal, firstyearincode
Published: 2021-06-13 00:16:26

So this week, or weekend, I decided to begin creating my first post-bootcamp-grad application! **YAY!**

As a lover of movies and television shows, I often find myself adding new items to my watchlist across different streaming services. My lists have become so long that I don't think I'll ever watch them all. I hate having multiple lists across the different services so I figured, why not create an application where you can compile your multiple watchlists into one?!  Well, that's exactly what I plan to do. 

![Spongebob Long List](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dd0foxmjwyolz7422sv.jpeg)

The last phase of my bootcamp taught me the basics of React and Redux. I am going to be very honest, learning it was _PRETTY_ difficult for me. I would usually learn the most during our project week because I am implementing every piece I was taught during lectures into my own application. However, since I had a bit of a harder time cementing my knowledge of it my project was quite basic. So, this time around, I want to reinforce the basics, but also take it a step further and teach myself a couple of new things. 

![Homer Thinking](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wk597hgdd4r9enbovck.jpeg)

I am the type of person who has to put my pen to paper when doing any sort of planning. I whipped out my handy dandy notebook and sketched out some quick ideas. Before I got too big for my britches, I decided to move forward and create my React app. At the bare minimum I will have the following components: User, Watchlist, Movies, Movie, Navigation Bar and Home. The API I discovered, [The Movie Database API](https://www.themoviedb.org/documentation/api), has an ABUNDANT amount of information to utilize so I am sure I will have more components join the party later on. 

The basics that I am beginning with will involve a homepage that will contain the movies component which will iterate through and display the available movies from the API. I will also implement a user profile page which will contain basic user information and the user's created watchlist. On this watchlist, users will be able to dropdown on a specific movie or tv show to gain further information on it (i.e. genre(s), overview, popularity, status and vote average).  

Once again, I am just kicking off this application of mine so be on the lookout for further updates as my application grows overtime. If you have any questions or suggestions feel free to reach out to me.

![Stay Tuned!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycs9hanr5aol7eaici7r.jpeg)
Notes on “How to Become a Better Developer With Nacho Iacovino“
Tags: codenewbie
Published: 2021-06-13 17:49:12

---
title: Notes on “How to Become a Better Developer With Nacho Iacovino“
published: true
date: 13/06/2021
cover_image: 'https://www.rockyourcode.com/static/img/2021-06-13-nachoiacovino-banner.jpg'
tags: codenewbie
canonical_url: https://www.rockyourcode.com/notes-on-how-to-become-a-better-developer-with-nacho-iacovino/
---

Notes from the Twitch stream with Francesco Ciulla and Nacho Iacovino (1 hour 17 mins):
[![How to become a better Developer | with Nacho Iacovino](https://i.ytimg.com/vi/AbdcoJHVutk/sddefault.jpg)](https://youtube.com/watch?v=AbdcoJHVutk 'How to become a better Developer | with Nacho Iacovino')

Nacho Iacovino is a self-taught developer from Spain who grew his Twitter account in a short time.

Here are some tips that he shared.

**Coding interviews**: He learned from each interview. Even if you can't answer a question, you can go home, research, and then you can answer the question on the next interview. It's a process.  
You also need to interview the company.

**Marketing/Followers**: Nacho made some useful Twitter threads and pinged the influential Twitter accounts for feedback (no spam, no selling, add value), hit a niche (Tailwind CSS).  
_Engage with bigger account._ Add value to other people's tweets. Use common sense.  
Choose one platform and be consistent.

**Becoming a better developer**: He quit JavaScript twice before he managed to become a developer full-time. _Be consistent._ You might not have 6 hours a day to learn to code, but at least do a little bit every day.  
Find the best way that works for you (video, tutorials, books).  
Don't copy a tutorial verbatim, try to experiment, embrace breaking the application and find out how to fix it. Challenge yourself.

**Portfolio**: Show what you're capable of. Udemy project clones are dimes and dozens, make it your own. Make it easy for others to contact you.  
Show the newest work first. Be concise. Say where you're based, so it's easy to see if the company can hire you.

**Learn in Public**: Nacho shared what he learned publicly on Twitter. People were reaching out to him, because they knew what he learned.  
Be your own teacher. What you write down you can use later.

## Links

- [How to become a better Developer | with Nacho Iacovino][youtube] on
  Francesco Ciulla's [YouTube channel](https://www.youtube.com/channel/UCBRxDSTfr2aJVODDh4WG_7g)

[youtube]: https://youtube.com/watch?v=AbdcoJHVutk
The misunderstood MVP
Tags: mvp, lean, automation, cicd
Published: 2021-06-16 19:09:14

---
title: The misunderstood MVP
published: true
date: 2021-06-13 00:00:00 UTC
tags: mvp,lean,automation,cicd
canonical_url: https://jhall.io/archive/2021/06/13/the-misunderstood-mvp/
---

I see a lot of people confused by the concept of an “MVP”, a concept made popular by Eric Ries’s book [_The Lean Startup_](https://amzn.to/2StmwGI).

Many seem to think that an MVP is just a beta or alpha release of a product or feature. And this leads to people saying things like “I don’t like the concept of a Minimum Viable Product. I prefer aiming for a Minimal Lovable Product.” But this is completely misunderstanding the purpose and meaning of an MVP, which is to begin the process of learning as quickly as possible. If you wait until your product is lovable, you’ve probably wasted months, or longer, of time you could have been learning. The risk is that you may build a lovable product nobody wants to use!

In his book, Ries illustrates an MVP with the example of [Zappos](https://www.zappos.com/) cofounder Nick Swinmurn. At the time, the idea of selling shoes on the Internet was new, and it wasn’t at all a sure bet. Shoes are very personal, and conventional wisdom was that you had to try on a pair (or 6) of shoes, for fit, color, and other charactaristics. So rather than building a “beta” version of zappos.com, Swinmurn went to a shoe store and took photos of some of their stock, and posted them on a simple web site. If and when someone placed an order for a pair of shoes, and not before, did Swinmurn go to the shoe store and buy the shoes—at retail price—then ship them to the cusomter, at a loss.

How can we apply the MVP mindset to DevOps?

Probably the simplest way is to systematize before automating. Remember: [humans are Turing complete](https://jhall.io/archive/2021/03/19/humans-are-turing-complete/), so use human labor to validate an idea before you spend time [automating it](https://jhall.io/archive/2021/03/23/how-to-automate-anything/). This is the core concept I employ in my free [Lean CD bootcamp](https://jhall.io/lean-cd-bootcamp/), which aims to teach you how to do Continuous Deployment without automation first.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._