teleren/devto huggingface dataset:
Responding to “We don't automate critical processes”
Tags: productivity, automation, devops
Published: 2021-02-19 08:34:15

---
title: Responding to “We don't automate critical processes”
published: true
date: 2021-02-05 00:00:00 UTC
tags: productivity, automation, devops
canonical_url: https://jhall.io/archive/2021/02/05/responding-to-we-dont-automate-critical-processes/
---

I was recently talking to the head of engineering at an IT infrastructure company. During the conversation he casually said “We don’t believe in automating processes that could result in serious errors.”

My jaw dropped.

To my mind, his approach is utterly backwards. All else being equal, critical processes—those where errors are potentially the most catastrophic—should be the _first_ to be automated. Why?

Because humans make mistakes all the time. (Working) computers never do.

Humans routinely forget to run automated tests; this is why they’re automated. Humans are notoriously bad at executing a 300-step build process; that’s why we script the build. Humans make arethemetic errors all the time; that’s why paying of taxes is automated.

When you look at the processes in your life, and are trying to decide which ones to automate, start with the ones where you are most likely to make mistakes.
Apply YAGNI to More Than Just Software
Tags: productivity, product
Published: 2021-02-10 11:19:20

---
title: Apply YAGNI to More Than Just Software
published: true
date: 2021-02-05 00:00:00 UTC
tags: productivity,product
canonical_url: https://mannes.tech/apply-more-yagni/
---

You aren't gonna need it.

That's a programming principle from extreme programming. It states that functionality should not be added until deemed necessary.

Let's explore how YAGNI is useful in software development, and as a general productivity tool.

## YAGNI For Feature Selection

Using YAGNI is a great idea.

There are infinitely many features you could add to your software. And infinitely many improvements to your code or infrastructure. But no project has infinite time or infinite resources, so we always need to choose what to work on and what to ignore.

The question is: what are we optimizing for?

As always, that depends.

But in most projects you'll want to optimize for **user perceived value**. Some call that [Customer Perceived Value](https://aircall.io/blog/customer-happiness/customer-perceived-value/).

That's the perceived benefits your application brings, minus its perceived cost to the user.

> Notice that we're talking about perceived benefits and costs. You can increase the perceived benefits to the user in two ways. You either increase the direct benefits of your solution, or you make the benefits more clear to your users, e.g. with more and clearer metrics about the value your solution brings. Same for perceived costs.

## YAGNI as a Productivity Tool

I find YAGNI is not only great for software development, but for individual productivity as well.

Here are some things you don't need:

* **You don't need to respond immediately** to instant messages or emails from your coworkers.
* **You don't need to act immediately** when you notice a shortcoming in your project or organization. Most times, doing nothing at first is the better option. Wait until that issue appears more often, and until you know about its impact and frequency before jumping to action.
* **You don't need to be always available.** Take your time for focused work.

## What To Do Next

The next time an urgent matter comes up, ask yourself (and the rest of the room) how urgent that matter really is.

> “Simplicity – the art of maximizing the amount of work not done – is essential.” – Agile Manifesto

[_Follow me on Twitter @simon_mannes_](https://twitter.com/@simon_mannes)
A session had already been started
Tags: errors, function, php, troubleshooting
Published: 2022-12-09 14:58:14

---
title: A session had already been started
published: true
date: 2021-02-05 00:00:00 UTC
tags: Error,Function,PHP,Troubleshooting
canonical_url: https://ahonerd.com/a-session-had-already-been-started
---

Solusi sederhana untuk menangani error pada PHP script yang berbunyi: <code><strong>Notice:</strong> session_start(): A session had already been started - ignoring in ...</code>

## PHP >= 5.4.0 || PHP 7 || PHP 8

Metode pertama adalah dengan menggunakan function `session_status()`

Function ini akan menghasilkan output sebagai berikut:
- `PHP_SESSION_DISABLED` if sessions are disabled.
- `PHP_SESSION_NONE` if sessions are enabled, but none exists.
- `PHP_SESSION_ACTIVE` if sessions are enabled, and one exists.

Untuk lebih jelasnya bisa lihat [di sini](http://www.php.net/manual/en/function.session-status.php).

Sehingga untuk mengatasi error <code><strong>Notice:</strong> session_start(): A session had already been started</code> bisa dengan cara memulai session setelah memeriksa status session, sebagai berikut:

```php
if (session_status() == PHP_SESSION_NONE) {
  session_start();
}
```

## PHP < 5.4.0

Metode berikutnya lebih kompatible untuk versi PHP yang lebih lawas, yaitu dengan menggunakan function `session_id()`.

Untuk lebih jelasnya bisa lihat [di sini](https://www.php.net/manual/en/function.session-id.php).

```php
if(session_id() == '') {
  session_start();
}
```
How to scroll to the bottom of the webpage using JavaScript?
Tags: javascript
Published: 2021-02-05 00:00:00

---
  title: How to scroll to the bottom of the webpage using JavaScript?
  published: true
  tags: JavaScript
  date: Fri Feb 05 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/scroll-to-bottom-of-webpage-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-65426b724ba9f00e4fa32962facc4dcd.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/scroll-to-bottom-of-webpage-javascript)
  
To scroll to the bottom of the webpage using JavaScript, first, we need to get the full scrollable height of the window. The scrollable height is the total pixels away from the top of the webpage.

We can get that using the `scrollHeight` property in the `document.body` global object like this,

```js
// get the scroll height of the window
const scrollHeight = document.body.scrollHeight;
```

Now, all we need to do is to use the [`scrollTo()` method](https://melvingeorge.me/blog/scroll-to-specific-position-in-window-using-javascript) in the global `window` object and pass `0` as the first argument and the `scrollHeight` as the second argument to it like this,

```js
// get the scroll height of the window
const scrollHeight = document.body.scrollHeight;

// scroll to the bottom of webpage
window.scrollTo(0, scrollHeight);
```

That's it 🌟!

See this example live in [JSBin](https://jsbin.com/yunaloriki/2/edit?html,js,output).

### Feel free to share if you found this useful 😃.

---
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2021-02-04 23:43:50

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

---

Congrats on this [win of the week](https://dev.to/devteam/what-was-your-win-this-week-145j), @ritaxcorreia!

{% devcomment 1b1hn %}

Thank you for contributing to the [Black History Month celebration](https://dev.to/devteam/tell-us-about-the-black-technologists-that-inspire-you-2m7b) here on DEV @krrishdhaneja! I need to check out Coldfusion on YouTube!  

{% devcomment 1b3i5 %}

"A single character typo brought me to my knees."
— @djtai in ["What's the longest you've ever spent debugging a single bug?"](https://dev.to/ben/what-s-the-longest-you-ve-ever-spent-debugging-a-single-bug-op4)


I can relate 😅 

{% devcomment 1b4md %}

@ziizium is a definite [Pro Googler](https://dev.to/denicmarko/google-like-a-pro-5cf6)!

{% devcomment 1b604 %}

Another awesome win of the week! I hope you're still celebrating, @ldrmuse 🎉 


{% devcomment 1b1ml %}

See you next week for more great comments ✌
Monorepo
Tags: tip, desarrollo, git
Published: 2021-02-04 23:13:26

---
title: Monorepo
published: true
tags: ['tip', 'desarrollo', 'git']
canonical_url: https://marceloandrader.github.io/blog/2021/02/04/monorepo/
---

En muchos sistemas modernos se opta por tener una aplicación web de página única o Single Page Application, en donde obligatoriamente tenemos al menos 2 partes, un backend y un frontend, los dos con diferentes estilos de programación y que deben ejecutarse en la misma versión para que todo funcione correctamente.

Cuando se almacenan estos dos sistemas en diferentes repositorios es difícil mantener la dependencia de versiones, por ejemplo que el frontend tenga una funcionalidad que depende de una función en el backend, si desplegamos solo el frontend corremos el riesgo de tener bugs en producción ya que al tratar de ejecutar esta función el backend no tiene forma de responder.

Hace un año con uno de mis clientes, hice una migración de una estructura multi repositorio a una de único repositorio o monorepo. Realmente fue un cambio significativo en la experiencia de desarrollo, teníamos 4 aplicaciones frontend 2 de administración y 2 portales web, cada una compartía 2 paquetes privados, y una REST API en PHP, por lo que teníamos 9 repositorios de código. Cuando hacíamos cambios era un dolor de cabeza el hacer que todas las dependencias vayan de la mano especialmente cuando hacíamos cambios en los paquetes privados.

Utilice estas herramientas [monorepo-tools](https://github.com/shopsys/monorepo-tools) que permiten importar todos los repositorios a uno solo, sin perder su historia, lo más importante durante este proceso es tratar de cerrar la mayoría de ramas de código para que no se pierda ningún commit.

Para desplegar un monorepo cualquier rama de código siempre está en la correcta dependencia, si una app de frontend usa una función del REST API, estamos seguros que esa función también está en el backend en esa rama, de esa forma al realizar el merge correspondiente, toda la funcionalidad se une a la rama principal y el despliegue es seguro.
Basic Widget Flutter
Tags: flutter, dart, mobile, android
Published: 2021-02-04 23:08:12

# Flutter 🤔 ?
Jadi [flutter](https://flutter.dev/) adalah framework mobile application yang dibuat oleh google dengan menggunakan bahasa [dart](https://dart.dev/) 🎯. Banyak hal keren dari flutter, yaitu salah satunya memiliki banyak widget - widget yang cantik.

&nbsp;
# Beberapa Contoh Widget Flutter
### - StatefulWidget

```dart
class SampleStatefulWidget extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _SampleStatefulWidgetState extends State<SampleStatefulWidget> {
  @override
  Widget build(BuildContext context) {
  
  }
}
```

Pada flutter pasti banyak variable dengan value yang berubah ubah saat membuat aplikasi dan tentunya mempengaruhi tampilan, disitu kita akan membutuhkan stateful dengan widget satu ini kita bisa mengubah tampilan sejalan dengan variable dengan mudah. Untuk mengubah tampilan kita harus menjalankan **setState()**, cara kerja setState yaitu dimulai saat pemanggilan disitu setState memberi tahu kalau ada perubahan pada variable kemudian framework merespon dengan membuild ulang widget tersebut.

### - StatelessWidget

```dart
class SampleStatelessWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
  
  }
}
```

Berbeda dengan stateful, widget stateless tidak bisa 
melakukan perubahan pada tampilannya, code penulisannya juga lebih sedikit. Jadi saat suatu variable yang melakukan perubahan pada value widget ini tidak akan ikut berubah.

### - Container

```dart
Container()
```

Container, widget yang paling sering dipakai dalam flutter 😮
Widget ini sering diakai untuk pembungkus widget lain, dengan container bisa melakukan banyak hal dari memberi jarak, mengatur ukuran, memberi warna pada background.

### - Text

```dart
Text()
```

Text, sesuai namanya widget ini digunakan untuk membuat text pada flutter, text yang dibuat juga bisa diubah ubah dengan mengganti warna ataupun ukuran, penggunaan widget juga bisa digabung dengan container.

```dart
Container(
    child: Text(
        'Hello World', 
        style: TextStyle(
            color: Color(0xffF8C92C)
        )
    )
)
```

### - Image

```dart
Image()
```

Dalam membuat aplikasi mobile pasti memiliki banyak object, salah satunya mengandung image, dalam membuat aplikasi flutter kita bisa menggunakan widget ini untuk menampilkan image, sumber image bisa dari url maupun dari local.
&nbsp;
Dibawah source code untuk menampilkan image dari local
```dart
Image(
    image: AssetImage('assets/image.png')
)
```
Day 302 : Broke
Tags: hiphop, code, coding, lifelongdev
Published: 2021-02-04 22:59:39

_liner notes_:
- Professional : Had our team meeting. It was really good to see everyone. Basically spent the rest of the day finishing up my blog post. Pretty chill day at the park and made a couple of laps.

- Personal : Went to Publix and stocked up on sushi and some other things. Went to my spot and just went through tracks for the radio show for the rest of the night.

![Overhead aerial shot a beach in Big Sur, California with a rock mass sticking out of the water](https://dev-to-uploads.s3.amazonaws.com/i/1htvaldxx1gd0vou57u6.jpg)

Going to go through more tracks for the radio show. Also going to watch another episode of "The Watch". Oh and I think I may have found a way around an issue that broke a previous side project. I may test it out and see if it works.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube haHoyfi9GFY %}
An idea for an amazing software project
Published: 2021-02-04 22:29:02

Hi everyone, I've been working in sales for a few years now, and I noticed some clear opportunities to make a lot of money in this industry. 

I have no programming skills and not enough money to hire any developers, so I'm giving this idea away for free, as a thank you for all the help and support this website (and a few others) have given me (mostly in regards to understanding the basics of programming)! 

The idea is to make a Slack bot that will allow you to easily create schedules with other users, which is the most irritating (and a very time consuming) part of my daily job. 

For example, you'd type in "@SalesMan" (which is the bot's name/handle) followed by an action such as "schedule a zoom meeting for Kevin and me, somewhere next week". It will automatically send Kevin a message, let him pick a date and time, verify it back with you if you can go on that time, etc. It will then also optionally send a reminder of it on the day that the meeting is planned. 

There are a bunch of tools that we are using here, one app is used for text, another for phone calls, another for video calls, etc etc. If you could make a bot that can send messages etc over these platforms, to schedule and connect people with it, it will be such a time saver and such a relief to the people in this line of work, companies/people will be willing to pay a lot of money for it. 

You could easily charge $300 a month for it per company. Get 10 or more companies signed up and you've basically got yourself a very decent salary for which you don't have to do anything for anymore. 

May this idea helps anyone out there! If you think you can develop it, go ahead and do so, I wish you a lot of luck! Maybe one day I'll be using your software.
AWS ECR in 3 Minutes
Tags: aws, cloudskills, containers, ecr
Published: 2021-02-04 22:21:52

## Overview

AWS [ECR](https://aws.amazon.com/ecr/) is a container registry service. It offers straightforward [pricing](https://aws.amazon.com/ecr/pricing/) with no upfront fees or commitments. The service is extremely easy to use. This is proven by the fact that it provides the commands you need to execute to push your container images into ECR from the AWS Console.

![ECR Push](https://dev-to-uploads.s3.amazonaws.com/i/j1xlashses88dviw81bi.jpg)

1. Create a Repository
2. Upload Container Image(s) to that Repository
3. Reference the Container Image(s)

![ECR Flow](https://dev-to-uploads.s3.amazonaws.com/i/uy5kqdye7whyad548x9p.png)

## Features
* [3rd Party Integrations](https://aws.amazon.com/containers/partner-solutions/)
* [Docker Support](https://www.docker.com/)
* [Image Replication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/replication.html)
* [Image Scanning](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html)
* [Marketplace for Containers](https://aws.amazon.com/marketplace/features/containers)
* [Open Container Initiative (OCI) Support](https://opencontainers.org/)
* [Lifecycle Policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html)
* [Public Container Gallery](https://gallery.ecr.aws/)
* [Tag Immutability](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html)
* Uses [IAM](https://aws.amazon.com/iam/) for Access Control
* Uses [KMS](https://aws.amazon.com/kms/) for Encryption
* Uses [S3](https://aws.amazon.com/s3/) for Availability/Durability

> https://aws.amazon.com/ecr/features/

## Integrations
* [ECS](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_on_ECS.html)
* [EKS](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_on_EKS.html)
* [ElasticBeanstalk](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.container.console.html)
* [Lambda](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html)
![Lambda Container](https://dev-to-uploads.s3.amazonaws.com/i/j4t50xsc4ix28ty78757.png)

## Resources

* [AWS ECR CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_ECR.html)
* [AWS ECR FAQs](https://aws.amazon.com/ecr/faqs/)
* [AWS ECR Private Documentation](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html)
* [AWS ECR Public Documentation](https://docs.aws.amazon.com/AmazonECR/latest/public/what-is-ecr.html)
* [Docker Getting Started](https://www.docker.com/get-started)
* [Play With Docker](https://labs.play-with-docker.com/)

## Walkthrough

### Create Image Repository
https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-console.html

### Deploy Containerized Lambda
https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/

### Using Amazon ECR with the AWS CLI
https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html
Using stacked modals with Ionic Vue
Tags: ionic, vue, modal, ios
Published: 2021-02-04 22:05:09

Since ionic 5 has been released it is possible to use a new component of the [iOS UI Kit](https://developer.apple.com/design/human-interface-guidelines/ios/app-architecture/modality/) that allows you to open content in a temporary mode that’s separate from the user's previous current context.

These contents are presented in a stack managed by the [ionic modal controller](https://ionicframework.com/docs/api/modal) and while they work very well on @ionic/angular and @ionic/react they are not yet fully supported in @ionic/vue but there is a way to have this feature working using a workaround, so be careful if using it in production.

In order to use stacked modals you need to have access to the current `IonRouterOutlet` reference but currently there is no official method to have a reference to it, so we use the vue3 [provide](https://v3.vuejs.org/guide/component-provide-inject.html#provide-inject) method to serve a reference from the app component and the [inject](https://v3.vuejs.org/guide/component-provide-inject.html#provide-inject) method to access it in each child component.

*/src/App.vue*
```vue
<template>
  <IonApp>
    <ion-router-outlet
      ref="routerOuteletRef"
      id="main-content"
    ></ion-router-outlet>
  </IonApp>
</template>

<script lang="ts">
import { IonApp, IonRouterOutlet } from "@ionic/vue";
import { defineComponent, ref, provide } from "vue";

export default defineComponent({
  name: "App",
  components: {
    IonApp,
    IonRouterOutlet,
  },
  setup() {
    // create an empty ref
    const routerOuteletRef = ref(null);
    // provide the value in the component hierarchy
    provide("routerOutlet", routerOuteletRef);

    return { routerOuteletRef };
  },
});
</script>

```

Now we use a generic "Home" component which contains a button that opens a new modal view of the same "Home" component

Note that stacked modals are activated by passing the presentingElement option to the modal controller.

*/src/view/Home.vue*
```vue
<script lang="ts">
import { defineComponent, inject } from "vue";
import { modalController } from "@ionic/vue"

import Home from "./Home.vue";

export default defineComponent({
  name: "Home",
  setup() {
    const outlet: any = inject("routerOutlet");

    const openModal = async () => {
      // use the last presenting element
      const top = (await modalController.getTop()) || outlet.value.$el;

      const modal = await modalController.create({
        component: Home,
        swipeToClose: true,
        presentingElement: top,
      });
      return modal.present();
    };

    return {
      openModal,
    };
  },
});
</script>
```
[Here a fully working](https://codesandbox.io/s/ionic-vue-stacked-modals-vnnuy) example in code sandbox.

{% codesandbox vnnuy %}
Adding git-bash to Visual Studio 2019 — No Extension Required!
Tags: git, visualstudio, gitbash
Published: 2021-02-04 21:12:45

---
title: Adding git-bash to Visual Studio 2019 — No Extension Required!
published: true
description: If you’re like me preferring to directly work with the git-bash command-line tool instead of using the Teams Explorer window in the Visual Studio 2019 you probably want to have the git-bash tool be accessible in a second!
tags: git,visualstudio,gitbash
//cover_image: https://dev-to-uploads.s3.amazonaws.com/i/mhafd76k4e5il0cmk6n8.png
---

If you’re like me preferring to directly work with the git-bash command-line tool instead of using the Teams Explorer window in the Visual Studio 2019 you probably want to have the git-bash tool be accessible in a second!

![The Git Bash tool in the Visual Studio 2019 Tools menu.](https://dev-to-uploads.s3.amazonaws.com/i/mhafd76k4e5il0cmk6n8.png "The Git Bash tool in the Visual Studio 2019 Tools menu.")


1. Make sure you have Git installed.
2. Open Visual Studio 2019 and go to Tools > External Tools…
3. Click on the Add button and fill the fields like this:
    * Title: Git Bash
    * Command: C:\Program Files\Git\git-bash.exe
    * Arguments:
    * Initial Directory: $(SolutionDir) and click on the Ok button.
4. From Tools > Options > Environment > Keyboard, enter `Tools.ExternalCommand2` (If it's your second custom external tool) in the text box under the "Show commands containing" and select it.
5. Then select the text box under “Press Shortcut keys” and press your favorite keys (like Alt+Space) and click on the Assign button and then click OK and you’re done!
Now whenever you want to do any deep dive git thing, just press Ctrl+Space and the git-bash command line will appear immediately!
Have a happy coding!
🔥 A curated list of awesome links related to MySQL Configuration Tuning
Tags: devops, database, webdev, linux
Published: 2021-02-04 21:06:36

We have collected an [amazing list](https://github.com/Releem/awesome-mysql-performance) of articles and resources that are related to MySQL configuration performance tuning.

You can help us by sending [Pull Requests](https://github.com/Releem/awesome-mysql-performance/pulls) to add more resources.