teleren/devto huggingface dataset:
What is Cloud and Why? Short Story of Cloud Computing
Tags: cloud, infographics
Published: 2023-01-26 00:22:38

---
title: What is Cloud and Why? Short Story of Cloud Computing
published: true
description: Short story of how and why cloud computing as we know it has emerged 
tags: cloud, infographics
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nh9878fbahkajbs0xvux.png
# Use a ratio of 100:42 for best results.
# published_at: current
---

Another story in pictures from me. This time it is about how and why cloud computing and cloud infrastructure have emerged. Hope you enjoy it and learn something new.

![What is cloud and why 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ka7u6j7aaf9puheqnkx7.png)
![What is cloud and why 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxqmwy3a2snrjhoc4mxw.png)
![What is cloud and why 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u76ffbtjst38yiklnm2c.png)
![What is cloud and why 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzqaz4yzdqwpr7dhoae5.png)
How to use the GH CLI with 2 accounts
Tags: gh, githubcli, ghcli, accounts
Published: 2023-01-26 00:13:23


> This article solves the following questions:
> How to use gh with 2 accounts, how can I use gh with 2 github accounts, multiple gh-cli accounts on one machine, github cli multiple accounts

---

It's incredibly boring having to do a gh auth login every time you want to use a different account. Today we're going to learn how to solve that by using an extension which allows us to create multiple profiles and switch between them based on the current directory. To do so, the steps are really simple:

1. Install the extension
`gh extension install gabe565/gh-profile`

2. Create your first profile
`gh profile create [NAME]`

3. Login as you usually do
`gh auth login`


Now, you have created a profile with an associated github account. You can create other ones too by following the steps 2 and 3 above.    

<br />

If you want to switch between multiple profiles you can use `gh profile switch [NAME]`

<br />

That's better, but I promised you we were going to be able to use different profiles based on the current directory. In order to achieve it, follow these steps:

1. Install and setup direnv following their official tutorial: https://direnv.net/docs/installation.html

2. Whenever you want to set a profile for the current repo, use the -l option:
`gh profile switch [NAME] -l` 

Done. Now whenever you use your terminal on the current directory, is going to be using that specific github profile. No need to keep switching anymore!
Lint Rust code with cargo clippy
Tags: rust, clippy, lint, chatgpt
Published: 2023-02-02 22:39:45

---
title: Lint Rust code with cargo clippy
published: true
date: 2023-01-26 00:00:00 UTC
tags: rust,clippy,lint,chatgpt
canonical_url: https://jimbobbennett.dev/blogs/cargo-clippy/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1togheuw99sl051dpwtm.png
---

> This blog post was a fun one to write - cos I didn’t! I actually learned about `cargo clippy` on a recent [Crack the code interview with Rust live stream](https://www.youtube.com/watch?v=2Dd6wACDna8) and decided a quick blog post would be fun.
> 
> So I launched [ChatGPT](https://chat.openai.com/chat) and asked it to write this post!

Rust is a powerful programming language known for its safety and performance. One of the great things about Rust is the abundance of tools available to make development easier and more efficient. One such tool is cargo clippy, which is a command-line utility for linting Rust code. In this blog post, we’ll show you how to use cargo clippy to identify and fix potential errors in your Rust code.

First, make sure that you have Rust and Cargo installed on your machine. If you don’t, you can download and install them from the official Rust website. Once you have Rust and Cargo set up, you can use the cargo clippy command to lint your code.

To lint a specific file, navigate to the root directory of your project in the command line and run the following command:

```bash
cargo clippy --file=path/to/file.rs
```

This will lint the file located at `path/to/file.rs`.

If you want to lint all the files in your project, navigate to the root directory of your project in the command line and run the following command:

```bash
cargo clippy

```

This will lint all the files in your project.

Cargo clippy will provide suggestions and warnings for potential errors in your code, such as unused variables, unnecessary operations, and more. For example, it will suggest more efficient ways of writing your code and point out common pitfalls that could lead to runtime errors.

You can also configure cargo clippy to check for specific types of errors. For example, you can use the `-A` flag to check for specific lints or use `-W` flag to check for warnings. You can find more information about these options in the official Cargo Clippy documentation.

In addition to linting your code, cargo clippy also provides options to customize its behavior. For example, you can configure the level of verbosity or the maximum number of suggestions to display. You can find more information about these options in the official Cargo Clippy documentation.

In conclusion, cargo clippy is a powerful tool that can help you to identify and fix potential errors in your Rust code. It’s easy to use and provides a lot of options to customize its behavior. By using cargo clippy, you can spend less time worrying about errors and more time focusing on writing great code.
Format Rust code with cargo format
Tags: rust, formatter, tooling, chatgpt
Published: 2023-02-02 22:41:00

---
title: Format Rust code with cargo format
published: true
date: 2023-01-26 00:00:00 UTC
tags: rust,formatter,tooling,ChatGPT
canonical_url: https://jimbobbennett.dev/blogs/cargo-fmt/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6u6bti0ffswoy2znjeh.png
---

> This blog post was a fun one to write - cos I didn’t! I actually learned about `cargo fmt` on a recent [Crack the code interview with Rust live stream](https://www.youtube.com/watch?v=2Dd6wACDna8) and decided a quick blog post would be fun.
> 
> So I launched [ChatGPT](https://chat.openai.com/chat) and asked it to write this post!

Rust is a popular programming language known for its safety and performance. One of the great things about Rust is the abundance of tools available to make development easier and more efficient. One such tool is cargo fmt, which is a command line utility for formatting Rust code. In this blog post, we’ll show you how to use cargo fmt to make your Rust code more readable and consistent.

First, make sure that you have Rust and Cargo installed on your machine. If you don’t, you can download and install them from the official Rust website. Once you have Rust and Cargo set up, you can use the cargo fmt command to format your code.

To format a specific file, navigate to the root directory of your project in the command line and run the following command:

```bash
cargo fmt --file=path/to/file.rs
```

This will format the file located at path/to/file.rs.

If you want to format all the files in your project, navigate to the root directory of your project in the command line and run the following command:

```bash
cargo fmt

```

This will format all the files in your project.

You can also format all the files in your project and check for formatting errors by running the following command:

```bash
cargo fmt --check

```

This will check for formatting errors and display them in the command line. If there are no errors, the command will exit with a `0` status code, otherwise it will exit with a non-zero status code.

In addition to formatting files, cargo fmt also provides options to configure the formatting behavior. For example, you can configure the number of spaces used for indentation or the maximum line width. You can find more information about these options in the official Cargo documentation.

In conclusion, cargo fmt is a powerful tool that can help you to make your Rust code more readable and consistent. It’s easy to use and provides a lot of options to customize the formatting behavior. By using cargo fmt, you can spend less time worrying about formatting and more time focusing on writing great code.
Coffee ☕| Navigate Drupal 10 with ease
Tags: drupal, webdev, beginners
Published: 2023-01-25 23:33:42

{% embed https://youtu.be/EDe9bXklByQ %}

```bash
ddev composer require 'drupal/coffee:^1.3'
ddev drush en coffee -y
```

## Prerequisites

* [DDEV](https://youtu.be/yFMSKNCUQDo)
What is Inverse of Control?
Tags: webdev, programming, computerscience
Published: 2023-01-25 23:32:06

Inverse of Control (IoC) is a design principle commonly used in web development to promote a loosely-coupled architecture. This principle is based on the idea that the flow of control in a software application should be inverted, with the system controlling the flow of execution rather than the developer.

One of the main benefits of IoC is that it allows for greater flexibility and maintainability in web applications. By inverting the flow of control, developers can create modular, reusable code that can be easily swapped out or updated without affecting the rest of the application. This makes it easier to add new features, fix bugs, and update dependencies without having to make changes to the entire application.

IoC can be implemented in web development through the use of dependency injection (DI) frameworks. These frameworks provide a way for developers to declare the dependencies of a class or component, and the framework will handle the creation and injection of those dependencies into the class. This allows for a separation of concerns, with classes only being responsible for their own functionality and not having to worry about creating or managing their dependencies.

One of the most popular IoC frameworks for web development is the Spring Framework. Spring is a Java-based framework that provides a comprehensive set of tools for building web applications, including support for dependency injection, aspect-oriented programming, and data access. It also provides a number of modules for building web applications, such as Spring MVC for building web services, and Spring WebFlux for building reactive web applications.

Another popular IoC framework is AngularJS, which is a JavaScript-based framework used for building web applications. AngularJS uses dependency injection to manage the components of an application, making it easy to swap out or update parts of the application without affecting the rest. AngularJS also uses a declarative approach to building web applications, which makes the code more readable and maintainable.

In summary, Inverse of Control is a design principle that promotes a loosely-coupled architecture in web development. It can be implemented through the use of dependency injection frameworks like Spring and AngularJS, which provide a way for developers to declare the dependencies of a class and the framework will handle the creation and injection of those dependencies. This allows for greater flexibility and maintainability in web applications, making it easier to add new features, fix bugs, and update dependencies.
Always Busy Running Your Business? 3 Steps From ”The 4-Hour Work Week” to Free Up Time and Achieve Your Dream Lifestyle.
Tags: career, productivity, startup, writing
Published: 2023-01-25 23:06:02

Instead of sitting at the office all day, you would like to do something else. Right?

"The 4-Hour Work Week" by Tim Ferriss provides insights on how to design the lifestyle you want. The book's framework gives you a detailed plan for achieving your dream lifestyle. Whether it's traveling the world, learning something new, or spending more time with your family.

It does so with a few simple steps:
- Identify what you need to achieve your lifestyle.
- Come up with an idea to create that lifestyle.
- Make sure you free up enough time to support that lifestyle.

I want to save you some time by summarizing the 3 main steps from the book to get a first glance at building your dream lifestyle.

## Create a lifestyle that provides you with freedom rather than money.

Freedom is more important than money.

It is important not to focus solely on money. If this is your goal, you will probably work 60 or 80 hours a week and not have any time to enjoy your money. Instead, focus on freedom and having the time to live the life you want. **Money should enable your lifestyle, not dictate it.**

So instead of making the most money, focus on making enough money for your lifestyle with as little involvement as possible.

## Find a business to support your lifestyle by quickly iterating and growing proven ideas.

To live your dream lifestyle, you will still need money to support it.

But rather than having a classic 9-to-5, which directly trades your time for money, try to decouple them. One of the best ways to do so is to create an online business that will make you money when you're away. Try to **explore as many ideas as possible, build a minimal viable product and see how the ideas are received.** If it works, expand it; if not, throw it away and focus on the next idea.

You don't need huge business ideas; you can use multiple, smaller ideas to achieve your income goal.

## You can grow your business without taking on more work by automating and outsourcing as much as possible.

When you have an idea that works, you must start growing it.

Do so by automating and outsourcing as much as possible, as you want to limit your involvement. To identify suitable tasks, you should keep a log of your tasks and how long they take you. The log will then be the basis as it allows you to identify repetitive tasks that take most of your time, the prime targets for either automation or outsourcing.

Remember, at the end of the day, **it's your goal to create a machine that only needs minimal input from you to keep running.**

---

I can't recommend the book enough! If you liked the ideas presented here, feel free to read the whole book and tell me what you thought about it.
One of the real gems with the DNF package manager: aliases
Tags: linux, dnf, packagemanager
Published: 2023-01-25 20:57:22

One of the things i _really_ like about the DNF package manager, is th built-in “alias” system. It's awesome. Because you know how it is, when you have package manager, and a lot of commands to keep track of - we tend to setup a bunch of aliases in our `.bash_files`. Like I have a few different ones I then source into my `.bashrc` depending on what system I've setup. So, on an Arch system, I have an pacman-file with only aliases for different pacman commands. With Debian I haven a file called ”apt”.
Then I can source them in `.bashrc` like:

```bash
for f in aliases functions git pacman; do
    [ -f ~/.bash.d/${f} ] && . ~/.bash.d/${f};
done
```

&nbsp;

With DNF, there is no need for that. Well, except maybe 1. I do have an alias with: `alias sdnf='sudo dnf '`.

But, it's really great, and you can keep your `.bash_files` cleaner - and, when exploring what you can do and setup with the alias system - you'll learn a lot about your package manager.


- - -

So, DNF have (by default) already a bunch of pre-defined aliases. Like: `in (install), rm (remove), ls (list), se (search), up (upgrade) + more`. If you read the `man dnf`, you can see all the ones that are already made.

And it's really easy to add them your self. Here's how you do it:

```bash
# Basic syntax
$ sudo dnf alias add <alias>=<command/replacement>

# List your added aliases
$ dnf alias list
```

- - -

### Examples

Here are a some examples, to show a few.

In Apt you have “show”, and in DNF it is “info”. So, after using a Debian system during the day, and then later back at home - I sometimes tend to mix them up. Easy to fix:

```bash
$ sudo dnf alias add show=info
```

There's already “up” for upgrade, so I've added:

```bash
$ sudo dnf alias add chup=check-update
```

There's already “rm” for remove, so I've added:

```bash
$ sudo dnf alias add aurm=autoremove
```

And here's an example of how you list them:

```bash
$ dnf alias list
Alias show='info'
Alias aurm='autoremove'
Alias chup='check-update'
Alias h='help'
Alias i='info'
Alias yin='in -y'
Alias yup='up -y'
```

- - -

There is one thing to be aware of though… You can read more about it in the manual, but when using an already defined command/alias - you need to “\backslash” it to prevent an infinite loop.

Maybe not a good example, but like:

```bash
$ sudo dnf alias add list='list installed'
```

That one needs a backslash, like:

```bash
$ sudo dnf alias add list='\list installed'
```

- - -

Well, it's easy, fun, and _really_ useful, and less clutter in you `.bash_files`. Plus, you'll learn more about DNF when exploring all its options.

&nbsp;

_// Happy hacking…_ ⌨️ :+1:

· Eric
A CloudFront Function to remove a specific value at the beginning of an URL
Tags: aws
Published: 2023-01-25 22:48:38

My usecase was :
- the CDN was delivering images from a S3 bucket
- the images URL pattern was `https://URL/images/something.jpg`
- there was not an "images" folder at the root of the S3 bucket, images like `something.jpg` were directly there

So I used this function and associated it to the right Behavior ("Viewer request" option) of my CloundFront Distribution :
```
function handler(event) {

    var request = event.request;
    
    if (request.uri.startsWith("/images/")) {
        request.uri = request.uri.substring(7);
    }
    
    return request;
}
```

Let me know if that helped you or if you have suggestion for improvements. Take care !
How web developers can assist in boosting your website's organic traffic and ranking
Tags: productivity, webdev, seo, devops
Published: 2023-01-25 22:45:19

Web developers can help with search engine optimization (SEO) in several ways.
First, they can ensure that the website is technically sound and easily [indexed by search engines](https://www.wpseo.buzz/). This includes creating a proper website structure, using appropriate meta tags, and properly utilizing technologies such as AJAX.
Second, [web developers](https://www.programer.ba) can assist in creating quality content that will attract visitors and improve the website's positioning in search results. This includes optimizing page titles and descriptions, using relevant keywords, and creating quality content that improves the user experience.
Third, web developers can help in building links that will improve the [authority and trust of the website](https://www.wpseo.buzz/category/wp-seo-authority/). This includes creating linked pages and receiving links from other websites.
In summary, web developers can provide crucial help in optimizing search by ensuring technical accuracy of the website, improving the quality of content, and increasing the authority and trust of the website.
{% embed https://twitter.com/wpseo_buzz/status/1618297330444406787 %}
Day 681 : Take It Easy
Tags: hiphop, code, coding, lifelongdev
Published: 2023-01-25 22:40:29

_liner notes_:
- Professional : Past couple days I haven't felt that great. Decided to take it easy today. Not sure if it was because I didn't have any meetings, but I got a bunch of stuff done. I was able to finalize the proof of concept code for a Web Component. Copied it over to the official repo. Wrote some documentation. Published an official package. Verified it still works. Not a bad day.

- Personal : Last night, went through some tracks for the radio show. I also finally got the stater project deployed. It doesn't look like what I want to accomplish is possible. I'll have to figure out a way around it. Normally it would be no problem cause normally my side projects are just for me, but this one I'm trying to make some money and want to make it as easy as possible for others to deploy the project without me having to do anything. I was tired, so I went to sleep.

![Densely packed green trees on top of hills on islands in shallow turquoise waters in Palau, Oceania](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6t9ghoff2ngjn7vw4qi4.jpg)

Going to go through more tracks for the radio show. Been working on adding authentication to the starter project. I think I got it working, but need it to do more. Going to play around with it and see what it can do. Maybe end the night watching some anime and relax some.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube C8aTvSbI4Ds %}
Default image load, while error happen at image loading time
Tags: react, javascript, webdev, programming
Published: 2023-01-25 22:25:33

It's common to load static/dynamic images at our wed application. But if some time images are fail to load for several reason as like:- 

a) Broken image link, 
b) Missing from our assets folder, 
c) Wrong naming of image file - etc...

So, by default catch these kind of image loading fail case, we can add some little set of logic that prevent our UI to display annoying placeholder that come with default browser behavior.

<u>**Note:**</u> this implementation is base on ReactJS, you can extract this logic as per your development environment.

Its become good, if you keep you **<u>default image file</u>** under **"/public"** folder if you are working on React project. Then you can directedly access this image from your source code.

```jsx
const YourComponent = () => {


  const handleImgLoadingError = (e) => {

    // default image add, if associated image is not available...
    e.target.src = '/images/YOUR-DEFAULT-IMAGE-FILE-NAME.jpg';

  };


  return (

    <div>
      <img
        src={`YOUR-IMAGE-SOURCE`}
        alt={`YOUR-IMAGE-FILE-NAME`}
        onError={(e) => handleImgLoadingError(e)}
      />
    </div>

  );
};

export default YourComponent;
```

Hope its will be little helpful for your project beatification. 

Thank You :)
Six Words -- A Unique Fullstack Application
Tags: showcase, javascript, webdev
Published: 2023-01-25 22:03:56

Hello all!

**TL;DR: https://sixwords.fatpancake613.repl.co/**

Recently a friend and I created a fullstack application with the stack Pug + Express. This was the second fullstack application that I was a part of building, and my first time using Express & Pug (I had used Next.js previously). Overall I found Express and Pug pretty nice and simple, but I still prefer the ease of client/server communication that I feel that I can achieve better with Next.js. It was nice though having a much smaller application size (express and pug took up so little storage compared to Next.js!)

The application idea was based on Ernest Hemmingway's famous six word story: "For sale: baby shoes, never worn." The idea of this application is to see what you can say in 6 words! It's a lot of fun to see what ideas you can form in such brevity.

Overall building this application was a wonderful experience and I had a lot of fun collaborating :) Collaboration is something I highly encourage; you can take a nice and easy pace and have a lot of fun along the way, making whatever you decide to make.

So finally, here are the links to the application:
Replit link: https://replit.com/@FatPancake613/SixWords?v=1 (source code && if you want to leave a like, we'd love that)
Website link where you can try it out: **https://sixwords.fatpancake613.repl.co/** (note you need a replit account)

Hope you enjoy, and happy coding!
F##king CHATGPT
Tags: webdev, ai, productivity, career
Published: 2023-01-25 21:52:01

**The CHATGPT is here!** You can do anything with it.
1. Make your resume more attractful and beautiful.
2. Make you a better person.
3. All of the tools are under your hand with this AI(Artifical Intelligence).
4. It will answers everything you want.
5. You can learn everything from it.
6. you can examine it and fix the problems of a instance project and tell to what to do.
7. ...
_*(AI won't replace you, the person who knows the AI will replace you.)*_