teleren/devto huggingface dataset:
How to upload an object to digital ocean spaces using python boto3 library.
Tags: django, python, digitalocca
Published: 2022-12-12 03:03:39

[DigitalOcean Spaces](https://m.do.co/c/127d01b87593) is an object storage service provided by DigitalOcean that makes it easy to store, manage, and serve large amounts of data in the cloud. You can use DigitalOcean Spaces to store files and media that you want to serve to users of your Django application. In this article, we will show you how to upload files to DigitalOcean Spaces using Django.

First, you will need to create a [DigitalOcean Space](https://m.do.co/c/127d01b87593) and obtain your access keys. You can find instructions on how to do this in the DigitalOcean Spaces documentation.

Get $200 Free credit from Digital ocean From this link, [Go Now](https://m.do.co/c/127d01b87593)

Install Boto

```
pip install boto3
```

Now create file name **upload_space.py**

```
import boto3
import botocore

session = boto3.session.Session()
client = session.client('s3',
                        endpoint_url='https://sfo3.digitaloceanspaces.com',
                        # Find your endpoint in the control panel, under Settings. Prepend "https://".
                        config=botocore.config.Config(s3={'addressing_style': 'virtual'}),
                        region_name='sfo3',  # Use the region in your endpoint.
                        aws_access_key_id='acess_key_id',
                        # Access key pair. You can create access key pairs using the control panel or API.
                        aws_secret_access_key='secreet_key')  # Secret access key defined through an environment variable.

# upload file
with open('path/banner_promo.png', 'rb') as file_contents:
    client.put_object(
        Bucket='myBuket',
        Key='banner_promo.png',
        Body=file_contents,
        ACL='public-read',
        ContentType='image/png'
    )


```
Now you can upload your file by running this script, by passing your file and content type
Get $200 Free credit from Digital ocean From this link, [Go Now](https://m.do.co/c/127d01b87593)

Thank you for reading my article! If you enjoyed it and would like to support my work, please consider buying me a coffee at **[Buy Me a Coffee](https://www.buymeacoffee.com/giasuddin)**. You can also learn more about me and my work by visiting my **[Giasuddin Bio ](https://bio.link/giasuddi)**and following me on LinkedIn and Twitter. Thank you for your support!
I made a tool for looking up ANSI color code
Tags: cpp, python, bash, color
Published: 2022-12-12 02:47:51

Repo: https://github.com/blueskyson/ANSI-escape-code-color

This small program can help me select ANSI color by specific numbers, then automatically generate color codes. Like the following picture:

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

1. Execute `./aecc -f` to look up font colors..
2. Execute `./aecc -b` to look up background colors.
3. Execute `./aecc 10 1` to generate the code of green font and red background. If you want to generate a bold font, execute `./aecc B10 1`.

This program is written in both cpp and python.
Journey with #AWSCommunity @ AWS User Groups Coimbatore
Tags: aws, awscommunity, meetup
Published: 2022-12-12 01:48:07


Getting back to #coimbatore for a session is always heart-warming especially when you hear someone call you "Akka (sister) ", which always gives a back-to-home feel.

Ragavendran Chandrasekaran, Gokul Karthick and Vijaya Nirmala Gopal have really planned for the AWS User Group Coimbatore #meetup as mini Community Day itself with #christmas theme.


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


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



I enjoyed sharing my Journey with #AWSCommunity which was very well received. What more you need if you could inspire someone and help them to move to next level?


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


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


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


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

As always proud to represent  AWS Users Group Bengaluru and AWS User Group India

Fantastic line of speakers Vijaya Nirmala Gopal Nirmalmahesh S Venkataraman R and Preethi Ramesh with great content.


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


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



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



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

Thanks to the host Presidio, Ramkumar Kuppuchamy, Arumugam, Hari and Team. 

Wonderful audience
![Audience](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4bm525lyj7a401w08tzn.png)


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

Some memories are always to cherish forever 

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


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


Links:

[LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:7007882035973279746/), [Twitter](https://twitter.com/installjournal/status/1602114684571615233)
Suggestion: cpanm is added to Perl core
Tags: perl, perlsuggestion
Published: 2022-12-12 01:42:16

I suggest cpanm is added to Perl core.

For now, cpanm is attached to all SPVM repositories for portable tests using Github Action.

And if anyone knows the way to install cpanm using IO::Socket::INET, please let me know.

The following oneliner failed.

```
perl -MIO::Socket::INET -e 'my $socket = IO::Socket::INET->new(PeerAddr => "cpanmin.us", PeerPort => 80, Proto=> "tcp");print $socket "GET / HTTP/1.0\r\n\r\n";print <$socket>;close($sock);' > cpanm
```

I got the answer. The following oneliner works well.

```
perl -MIO::Socket::INET -e 'my $socket = IO::Socket::INET->new(PeerAddr => "cpanmin.us", PeerPort => 80, Proto=> "tcp");print $socket "GET / HTTP/1.0\r\nHost: cpanmin.us\r\n\r\n";;print <$socket>;close($sock);' > cpanm
```

cpanm can be used from Perl 5.8.1.
Quick reference guide to the most used commands in Git
Published: 2022-12-12 01:25:51


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34x9q199zqqnctt68heh.jpeg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2qdwmszqm2fhmkfxhgv.jpeg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thb1y2t1vv10q1z1b9vb.jpeg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cq2gvx7l4i67gc6zc5ne.jpeg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b15x94bi0ugf9vj8udj0.jpeg)
Typescript: La palabra clave extends
Tags: typescript, webdev, spanish
Published: 2022-12-12 01:18:25


> Este artículo fue originalmente escrito en [https://matiashernandez.dev](https://matiashernandez.dev/blog/post/typescript-la-palabra-clave-extends)



## La palabra clave extends

Typescript es un lenguaje completo (un lenguaje completo de Turing); por lo tanto, tiene algunas palabras clave con las que trabajar. Una de ellas es `extends`. 

Esta palabra clave puede ser muy confusa ya que engloba un par de conceptos o significados que dependen del contexto en el que se utilice.

### Herencia con `extends`

La herencia en Typescript se refiere a permitir crear nuevas interfaces que heredan o extienden el comportamiento de una anterior.

  


```typescript
interface User {
  firstName: string;
  lastName: string;
  email: string;
}

interface StaffUser extends User {
  roles: Array<Role>
}

```

Lo que se puede ver en el fragmento anterior es:

* La interfaz `User` describe un tipo con algunas propiedades que representan a un usuario.
* La interfaz `StaffUser` representa a un usuario con las mismas propiedades que `User` pero además una más: roles.
* Este uso de extends se puede utilizar para heredar de múltiples interfaces simultáneamente con sólo utilizar nombres separados por comas de las interfaces base.

```typescript
interface StaffUser extends User, RoleUser {

}
```

> Este comportamiento también se puede utilizar para extender una Clase

### extends como restricción.

También se puede utilizar `extends` para restringir el tipo o limitar el ámbito de un tipo.

```typescript
export type QueryFunction<
  T = unknown,
  TQueryKey extends QueryKey = QueryKey,
> = (context: QueryFunctionContext<TQueryKey>) => T | Promise<T>
```

El ejemplo anterior (de una implementación real de tanstack-query) muestra un tipo llamado `QueryFunction`. Este es un tipo genérico que acepta dos valores: `T` y `TQueryKey`.

> El uso genérico aquí es muy similar a una función en javascript, que acepta dos argumentos.

Lo que importa aquí es observar el uso de la palabra clave `extends`: `TQueryKey extends QueryKey = QueryKey`. Esto se puede leer como `TQueryKey` y debe ser de tipo `Query` con un valor por defecto de `QueryKey`.

El uso anterior de extends acotando o restringiendo el genérico es la piedra angular para poder implementar tipos condicionales ya que los extends se utilizarán como condición para comprobar si un genérico está fuera de un tipo determinado.



![Footer Social Card.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1615457338201/5yOtr5SdF.jpeg)
✉️ [Únete a Micro-bytes](https://microbytes.matiashernandez.dev)         🐦 Sígueme en [Twitter](https://twitter.com/matiasfha)           ❤️ [Apoya mi trabajo](https://buymeacoffee.com/matiasfha)
Faça seu tema no Visual Studio Code
Tags: vscode, frontend, webdev, tutorial
Published: 2022-12-12 01:04:52

Passo a passo rápido e pratico. Mais informações pode conferir no canal do youtube @codelikeagirlbrasil 

Requisitos: ter instalado o npm

1° PASSO RODAR OS COMANDOS NO TERMINAL

`npm install -g yo generator-code`

`npm install -g vsce`

`yo code`

2° PASSO, SELECIONE A OPÇÃO "New Color Theme"


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

Preencha da seguinte forma:

What's the name of your extension? nome-do-tema
What's the identifier of your extension? nome-do-tema
What's the description of your extension? Breve descrição sobre o tema
What's the name of your theme shown to the user? Nome que será exibido para o usuário

Você deve escolher entre um tema Dark ou Light, sendo dark para escuro e light para claro.

3° PERSONALIZE SEU TEMA TROCANDO AS VARIÁVEIS NA PASTA THEMES 

PRESSIONE F5 PARA PRÉ-VISUALIZAR SUAS ALTERAÇÕES
-recomendo fortemente assistir o vídeo https://www.youtube.com/watch?v=jGH7dkqGEvg&t=24s

4° APÓS TERMINAR DE PERSONALIZAR SEU TEMA VOCÊ VAI PUBLICAR COM AZURE
- vídeo de publicação https://www.youtube.com/watch?v=PMX1xUvuHTg&t=131s

5° FAÇA SEU CADASTRO NO LINK https://dev.azure.com/

6° CRIAR UM ACCESS TOKEN

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

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

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

7° COPIE SUA SENHA E FAÇA O LOGIN NO TERMINAL


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

comando para login(alterar <publisher name> colocando sua organização, ex: vsce login stefanycr.. forneça a senha da imagem acima):

`vsce login <publisher name>`

Após logar, você pode publicar sua extensão com apenas um comando
 
`vsce publish`

OBS: Cada publicação deve mudar a versão do package.
A Roadmap for Transferring Skills from Mechanical Design Engineering to Fullstack Development
Tags: career, realworld, skills, fullstack
Published: 2022-12-14 14:44:35

---
title: A Roadmap for Transferring Skills from Mechanical Design Engineering to Fullstack Development
published: true
date: 2022-12-12 00:29:22 UTC
tags: #career, #realworld, #skills, #fullstack
canonical_url: https://blog.timdehof.dev/a-roadmap-for-transferring-skills-from-mechanical-design-engineering-to-fullstack-development
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snt188c0x5ioo17urvq5.png
---

As a mechanical design engineer, you have developed a wealth of knowledge and expertise that can be applied to a career in fullstack development. By following this roadmap, you can successfully transfer your skills and achieve success in this exciting and rapidly-growing field.

**Step 1** : Analyze your existing skills and knowledge, and identify which ones are most relevant to fullstack development. Some transferable skills include:

- Problem-solving and critical thinking

- Technical skills, such as proficiency in CAD software

- Attention to detail and accuracy

- Ability to work independently and as part of a team

- Strong communication and collaboration skills.

**Step 2** : Develop any additional knowledge or skills that may be required for fullstack development, such as programming languages or web development frameworks. There are many resources available to help you learn these skills, such as online courses, workshops, and conferences. Invest in your education and professional development to continue growing and excelling as a fullstack developer.

**Step 3** : Apply your skills to real-world projects. This may involve working on personal projects, participating in hackathons, or contributing to open-source projects. Some examples of real-world projects to showcase your skills include:

- Building a personal website or blog
- Developing a web application for a local business or organization
- Contributing to an open-source project on GitHub

**Step 4** : Continuously learn and grow in your career as a fullstack developer. The field of fullstack development is constantly evolving, so it is important to stay up-to-date with the latest technologies and best practices.

By following this roadmap and transferring your skills from mechanical design engineering to fullstack development, you can achieve success and advance your career. Start your journey today and take the first step towards a rewarding career as a fullstack developer.
Division vs. Integer Division
Tags: python, beginners
Published: 2022-12-12 00:09:21

Hi everyone! Found another cool trick relating to division in Python. I was testing some things and came upon a script that produced an error even though I didn't think it should've.

```
for x in range(0, 42/6):
  print(x)
```

Turns out that Python doesn't like when a **floating-point** number is used in a range. And this led me to my first discovery, that the Python division operator always returns a floating-point value. So in my script, it was returning `8.0` instead of my desired `8`.

So how to get the `8`? Well, let's turn to the Python floor division operator (`//`). This returns an integer value, and it's helpful for when we're dividing two numbers **that we know will divide cleanly**. If they don't divide cleanly, it returns the cleanly floored value (8.8 rounds to 8, 7.3 to 7 and so on). This is so that it's always able to return a non-floating integer. So my original code updates to the following.

```
for x in range(1, 42//6): # returns 8!
  print(x)
```

In conclusion:
`/`: returns a floating point representing the number on the left divided by the number on the right
`//`: returns an integer representing the floor of the number on the left divided by the number on the right

Make sure to follow for more JS/Python code tidbits!
How to install cpanm using HTTP::Tiny and Perl oneliner?
Tags: perl, cpanm, http, oneliner
Published: 2022-12-11 23:48:22

How to install cpanm using HTTP::Tiny and Perl oneliner?

```
perl -MHTTP::Tiny -e 'print HTTP::Tiny->new->get("http://cpanmin.us/")->{content};' > cpanm
```

Use cpanm in the portable way.

```
perl cpanm -h
```
Remove Blank Lines from a File with Python
Tags: python, beginners
Published: 2022-12-11 23:40:06

Hi everyone! After fighting with syntax errors for the last ten minutes, I've finally figured out an elegant one-liner that removes all blank lines from a Python file.
```
with open('your_file.txt') as file:
  lines = list(filter(lambda l: l.strip(), file.readlines()))
  for line in lines:
    print(line)
```
I had already been told that the `strip()` method was the way to go when determining blank lines, so I simply incorporated it into a `lambda` function. Best part in my opinion - it doesn't mutate the original file because it uses `filter`.

Make sure to follow for more interesting JS/Python tidbits!
Typescript: The extends keyword
Tags: webdev, typescript
Published: 2022-12-11 23:39:28


> Este artículo fue originalmente escrito en [https://matiashernandez.dev](https://matiashernandez.dev/blog/post/typescript-the-extends-keyword)



## The `extends` keyword

Typescript is a complete language (a Turing complete language ); thus, it has a few keywords to work with. One of that keywords is `extends`. This keyword can be very confusing since it encompasses a couple of concepts or meanings that depend on the context where it is used.  


### Inheritance with `extends`

The inheritance in Typescript refers to allowing you to create new interfaces that inherit or **extend** the behavior of a previous one.  


```typescript
interface User {
  firstName: string;
  lastName: string;
  email: string;
}

interface StaffUser extends User {
  roles: Array<Role>
}

```

What you can see in the above snippet is:

* The interface `User` describes a type with some properties that represent a user.
* `StaffUser` interface represents a user with the same properties as `User` but also one more: roles.

This usage of extends can be used to inherit from multiple interfaces simultaneously by just using comma-separated names of the base interfaces.



```typescript
interface StaffUser extends User, RoleUser {

}
```

> This behavior can also be used to extends a `Class`

### extends as constrain.

`extends` can also be used to constrain the type or to narrow the scope of a type.

```typescript
export type QueryFunction<
  T = unknown,
  TQueryKey extends QueryKey = QueryKey,
> = (context: QueryFunctionContext<TQueryKey>) => T | Promise<T>
```

The example above (from a real-world implementation of tanstack-query) shows a type named as `QueryFunction`. This is a generic type that accepts two values: `T` and `TQueryKey`.

> The generic usage here is very similar to a function in javascript, which accepts two arguments.

What matter here is to note the usage of the `extends` keyword: `TQueryKey extends QueryKey = QueryKey`. This can be read as `TQueryKey` and should be of type `Query` with a default value of `QueryKey`. 



The previous usage of extends narrowing down or constraining the generic is the cornerstone to be able to implement conditional types since the extends will be used as a condition to check if a generic is off a particular type.



![Footer Social Card.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1615457338201/5yOtr5SdF.jpeg)
✉️ [Únete a Micro-bytes](https://microbytes.matiashernandez.dev)         🐦 Sígueme en [Twitter](https://twitter.com/matiasfha)           ❤️ [Apoya mi trabajo](https://buymeacoffee.com/matiasfha)
How To Install cpanm on Ubuntu 20.04?
Tags: perl, cpanm, ubuntu, linux
Published: 2022-12-11 23:36:04

How To Install cpanm on Ubuntu 20.04?

Please see <a href="https://installati.one/ubuntu/20.04/cpanminus/">How To Install cpanminus on Ubuntu 20.04 | Installati.one</a>

```
sudo apt-get update
sudo apt-get -y install cpanminus
```
8 practical tips to boost the on-page SEO in no time
Tags: webdev, design, html, beginners
Published: 2022-12-11 23:33:55

On-page SEO (Search Engine Optimization) refers to the practice of optimizing individual web pages to improve their ranking in search engine results which plays a critical role in the success of a website.

In this blog post, I'll provide 7 tips and strategies for improving the on-page SEO of your website. By following these tips, you can quickly increase the visibility of your website in search engine results and improve its overall performance.

> Before we move on, remember you can implement your websites or landing pages **with or without** coding on [DoTenX](https://dotenx.com) for **free**. Make sure to check it out and even nominate your work to be showcased there as well.

* * *

Now, let's begin.

1.  **Use keywords in your page titles and descriptions**: When composing your page titles and descriptions, be sure to use keywords that are pertinent to your company and the page's content. Search engines will be better able to comprehend the content of your website and will rank it higher in search results as a consequence.
    
2.  **Use header tags to structure your content**: Search engines can better grasp your content's structure and increase its relevance to certain keywords by using header tags (H1, H2, etc.). Use them to divide your text into sections and sub-sections and make sure the tags contain your keywords.
    
3.  **Use alt tags for images**: Search engines can't see images, so be sure to use alt tags to describe the content of your images. This can enhance your page's relevancy to particular keywords and increase your website's usability for screen reader users.
    
4.  **Use internal linking**: Internal linking can help search engines understand the structure of your website and improve its relevance to specific keywords. Use anchor text (the clickable text in a link) that includes your keywords, and link to relevant pages on your website to improve the SEO of those pages.
    
5.  **Use social sharing buttons**: Social sharing buttons can boost your website's visibility on social media networks. This may increase the amount of links pointing to your website, which may raise its position in search results.
    
6.  **Optimize your website's loading speed**: A slow-loading website can negatively impact your search engine rankings. Use tools like Google PageSpeed Insights to analyze your website's loading speed and identify areas for improvement.
    
7.  **Use a responsive design**: Your website's mobile user experience and search engine rankings can both be enhanced by a responsive design. Use a responsive design so that your website will automatically adapt its layout to accommodate multiple screen sizes.
    
8.  **Create high-quality, unique content**: High-quality, unique content can improve the relevance of your website to specific keywords and improve its ranking in search results. Create content that provides value to your users and is optimized for search engines using the tips above.