teleren/devto huggingface dataset:
My Experience with a Drupal 8/9 Update  Part 2: The Remote Site
Tags: webdev, php
Published: 2021-08-04 19:22:58

<a href="https://dev.to/nevkatz/my-experience-with-a-drupal-8-9-update-c8j">Part 1</a> | Part 2 |  <a href="https://dev.to/nevkatz/my-experience-with-a-drupal-8-9-update-part-3-database-updates-30na">Part 3</a>

Alright, this is Part 2 of my writeup on my Drupal 8/9 upgrade. 

After a day of adding back the themes and all my modules to a local 9.2.3 setup with Lando, my local site is now up and running. 

BUT...the first remote site gives me a WSOD. So that is the first puzzle of the day.

## Updates

* I am now working on getting my remote site working as well. On the Acquia Logs I am getting this nice little error.

* <pre>
<code>
Uncaught PHP Exception InvalidArgumentException: "No converter has been registered for paramconverter.latest_revision" at /mnt/www/html/abemultisite1ysumx4zdc3/docroot/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php line 39 request_id="v-5d494db2-f558-11eb-82e1-0a7156243103" 
</code>
</pre>

* Let's see if I can track this down.

* I suspect this may have to do with the Acquia Connector module.

* Acquia's <a href="https://docs.acquia.com/cloud-platform/create/install/drupal9/">Drupal 9 Installation Guide</a> could be a good resource for other Acquia D9 sites. May be too far along with this one to make use of it, though.

* Just ran <code>composer run enable-asset-packagist </code> within the lightning profile and then ran <code>composer update</code> at root.

* Just added Acquia Connector and Acquia search. They are off, but I want to be prepared. 

* Alrighty, I am at the update.php page. Get ready for over 112 updates.

* There is a warning that lightning and lightning media are not present and are required in schema, but I know they are. It didn't stop me on my local. I'm going to update the database manually and then run the update.
* Ran the database update and the main hub site now works remotely!
* Ah, I am getting messages on French translation files being imported. Very interesting.
* The layout of the page is off. I wonder what could be causing that. 
* Turning off layout builder on the front page fixed the layout.
* Turned on devel entity updates to fix an issue with compact date range.
* Running <code>drush entup</code> in live dev mode updated the compact date range on the second try. (On the first try, there was an autoload.php error.) 

Overall, good progress today. Both the Hub site and the france site work remotely after their updates. There are warnings about deprecated modules and such but those are for another day. Overall now the rest of this D8/D9 upgrade seems feasible now.

### Elsewhere

## Elsewhere

<a href="https://nevkatz.medium.com/7-tips-on-upgrading-from-drupal-8-to-drupal-9-648f519d6e7e?sk=fe2d0816cb852a7b5ca3dfaf0b6fa131">7 Tips on Upgrading from Drupal 8 to Drupal 9</a>
How to pass functions from child component to parent in React without useRef or useImperativeHandle 
Tags: react, javascript
Published: 2021-08-04 19:21:45

It's easy, just `useState` in the parent and give the child a setter:

```js
function Parent() {
    const [api, setApi] = useState()
    return <>
        <button onClick={()=>api.doAlert()}>Trigger alert in child</button>
        <Child setApi={setApi}/>
    </>
}

function Child({setApi}) {
    const [counter, setCounter] = useState(0)
    const doAlert = () => alert("counter is " + counter)
    useEffect(() => setApi({doAlert}), [counter])
    return <button onClick={() => setCounter(c => c + 1)}>
        Increment child counter
    </button>
}
```

Demo: https://jscomplete.com/playground/s732915
360° Refactoring
Tags: jupyter, refactorit
Published: 2021-08-04 19:05:38

![360 Degree Refactoring](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/foaj2lbv4d6tolerlvi4.png)

As part of my preparation to lead next week's instance of our weekly ['Programming Quantum Computers bookclub'](https://www.youtube.com/watch?v=QIC8PBmnRhc&list=PLIrLpelK7F7-pGGMKph7dHuJWwEswnXOc), I did a little exercise in refactoring.

I find myself refactoring not only code, but also comments and other elements of examples and samples for learning.  In this case I show how I approach refactoring for a sample in a Jupyter notebook.  This particular sample is in the [Cirq (Python-like) quantum computing library](https://quantumai.google/cirq) and it shows an example of how to implement [Shor's algorithm](https://en.wikipedia.org/wiki/Shor%27s_algorithm) using Cirq running on [Google Colab](https://colab.research.google.com/).

I've been doing this frequently, so I decided to make a short screencast to show a bit more detail about the process of 360° refactoring.  

[Link to screencast](https://www.youtube.com/watch?v=3rgzin_tIJ4)

What about you?  How/when do you use refactoring to learn?  Share in the comments.

happyRefactoring!
Kubernetes Security Hardening Guidance
Tags: kubernetes, security
Published: 2021-09-08 01:57:29

---
title: Kubernetes Security Hardening Guidance
description: Essential Kubernetes hardening guidance from the National Security Agency (NSA) and the Cybersecurity and Infrastructure Security Agency (CISA) is now available as a PDF report.
published: true
date: 2021-08-04 19:00:00 UTC
tags: kubernetes, security
canonical_url: https://www.doppler.com/blog/kubernetes-security-hardening-guidance
---

How to increase the security posture of a Kubernetes cluster is always top of mind for cluster administrators.

While we recommend starting with the [documented Kubernetes security best practices](https://kubernetes.io/docs/concepts/security/), a new resource to add to your must-read list is the [Kubernetes Hardening Guidance Report](https://media.defense.gov/2021/Aug/03/2002820425/-1/-1/1/CTR_KUBERNETES%20HARDENING%20GUIDANCE.PDF).

Produced by the National Security Agency (NSA) and the Cybersecurity and Infrastructure Security Agency (CISA), it details the most critical threats to the security of Kubernetes environments, providing guidance for cluster configuration in order to minimize risk.

More specifically, the report focusses on hardening techniques in three main areas:

*   Container and Pod scanning for vulnerabilities, weaknesses, and misconfiguration
*   Running containers and Pods with the most restrictive set of privileges possible
*   Network security recommendations for firewall configuration, network separation, authentication, and log auditing

You can download the report from [https://media.defense.gov/2021/Aug/03/2002820425/-1/-1/1/CTR\_KUBERNETES%20HARDENING%20GUIDANCE.PDF](https://media.defense.gov/2021/Aug/03/2002820425/-1/-1/1/CTR_KUBERNETES%20HARDENING%20GUIDANCE.PDF)

---

[![Create your free Doppler account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lcu1dmvld1wzmz3b0wl0.png)](https://dashboard.doppler.com/register?utm_source=dev&utm_medium=blog&utm_content=doppler-kubernetes-security-hardening-guidance-2f7b)
Dynamics 365 Commerce POS: Add validation before adding an item to cart
Tags: devjournal, dotnet
Published: 2021-08-04 18:12:13

**Problem:**
The Customer requires validation to be added before an item is added into a cart in POS. For example, an item must belong to a certain list to be purchased from POS. Or any criteria whatsoever.

**Development:**
When an item is being added into a cart, one of the requests triggered is SaveCartVersionedDataRequest. We can add a pre-trigger to this request as a Commerce Runtime (CRT) extension. We’d need to implement the IRequestTriggerAsync interface and implement mandatory methods.
```
public class AddItemToCartValidationTrigger : IRequestTriggerAsync
{
    public IEnumerable SupportedRequestTypes => new[]
    {
        typeof(SaveCartVersionedDataRequest)
    };
 
    public async Task OnExecuted(Request request, Response response)
    {
        await Task.CompletedTask;
    }
 
    public async Task OnExecuting(Request request)
    {
        boolean criteria = true;
 
        if (criteria) // if some criteria is met, add an item to the cart
        {
            // do something
        }
        else // reject item to be added to cart
        {
            // throw commerce exception
        }
    }
}
```
**Deployment:**
Build your CRT extension and place it in the Retail Server’s extension folder. Drop extension .dll in 'RetailServer\WebRoot\bin\Ext' folder and modify CommerceRuntime.Ext configuration file by adding extension assembly reference in composition section of config file. Restart the Retail Server after adding an extension to it.

To debug locally you can also add this extension .dll in 'C:\Program Files (x86)\Microsoft Dynamics 365\70\Retail Modern POS\ClientBroker\ext' folder and add reference of extension assembly in 'CommerceRuntime.MPOSOffline.ext' config file. Attach it to the IIS process of the Retail Server.

For Retail SDK build, you’d need to add this CRT extension to 'CommerceRuntime.ext' config in 'RetailSDK>Assets' and 'customization.settings' in 'RetailSDK>BuildTools'.
Pure HTML CSS Tabs
Tags: css, tabs, responsive, html
Published: 2021-08-04 17:23:25

HTML tabs are perfect for web applications. Different subjects can easily be displayed with tabs ui design. You will love these simple and well designed tabs.

## Layout

Tabs layout is enhanced with Google material icons. These are CSS only tabs and are compatible with modern browsers.

## Responsive

These Pure HTML CSS tabs are responsive. You will observe a behaviour of accordion tabs on small displays.

![Responsive CSS Tabs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vj0mf0289zvjxac4mbej.jpeg)

## Tools

* HTML
* CSS

## Features

* Material Icons Support
* Responsive CSS Tabs
* Modern Design
* Clean Code

## Details

* [Demo](https://htmlcssfreebies.com/demo/?id=20)
* [Download](https://htmlcssfreebies.com/pure-html-css-tabs/)
* [Playground](https://codepen.io/htmlcssfreebies/pen/WNpVeRK)

## Feedback

Your feedback will help us to improve these tabs.
Fix OBS NVENC or AMD bug on Arch Linux
Tags: linux
Published: 2021-08-04 17:20:57

Photo by <a href="https://unsplash.com/@4dgraphic?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Alexander Dummer</a> on <a href="https://unsplash.com/s/photos/obs-studio?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

**TL;DR**
Fix the error "Starting the output failed. Please check the log for details". This fix works for me. On the web exist many ways to fix it. The best option is to go to the official discord of [OBS Studio](https://discord.gg/obsproject).

## The lifestreaming in an Arch Linux distro
I have been streaming on [Twitch](https://twitch.com.daniloassis_) for some time. And, whenever I will start the OBS since I'm using Arch Linux, it is like a surprise box. Every new try to stream can be displayed a new error.

This is not a criticism, this is the price of using an amazing open-source system like Linux.

To pay back the work of many people for this open-sourced tool, every time I face a new error and find how to fix it, I need to share the fix and kept improving the [Learn in Public](https://dev.to/daniloab/how-to-learn-in-public-9ng).

## FIX
Probably, if you are facing this problem on Arch Linux, it is because a new version of the lib was shipped and the lib needs to be built again.

I'm using the `obs-studio-git 27.0.0.rc6.r0.g6792e9c1c-1` and being helped by the people from OBS discord, my fix, simply, was to reinstall the same lib again.

`yay -S obs-studio-git`

Doing this, the lib was rebuild and the transmission starts to works normally again.

## TIP
A tip from the user `tytan652`

```text
On ArchLinux if a library receives a major update most of the package built against are rebuilt and for AUR package users need to rebuild it themself
```

If you find another way to fix this, please, share it in the comments.

## LINKS
Watch me on [Twitch](https://twitch.tv/daniloassis_)
Be my [Patreon](https://www.patreon.com/daniloab)
Solving The Move Zeroes Challenge in Python, three approaches
Tags: python, algorithms, codequality
Published: 2021-08-04 17:04:57

A while ago, my colleague and I were discussing a very interesting question on data structures and algorithms. This question is provided by [LeetCode](https://leetcode.com/problems/move-zeroes/)
Our thoughts were on the different ways we would try to arrive at the solution factoring in all constraints given. To give you a perspective, here is the problem statement:
_Given an integer array `nums`, move all `0's` to the end of it while maintaining the relative order of the non-zero elements._
__Note__ _that you must do this in-place without making a copy of the array._
So if we have a list of numbers like:
```
nums=[8,0,3,5,0,4]
```
We move all 0's to the end of it while retaining the non-zero numbers such that:
```
nums=[8,3,5,4,0,0]
```
The first solution which is not very optimal and would break the `in place` constraint would be to make a copy of the array and insert non-zero elements by:
```python
nums=[8,0,3,5,0,4]
def move_zeroes():
  zeroes=[]
  non_zeroes=[]
  for i in nums:
    if i ==0:
      zeroes.append(i)
  for i in nums:
    if i !=0:
      non_zeroes.append(i)
  print(non_zeroes + zeroes)
```
That is a huge chunk so can we tidy it up a lil bit? Of course using list comprehensions such that:
```python
def move_zeroes():
  pri nt([i for i in nums if i !=0]+[i for i in nums if i ==0])
```
But that wouldn't be the best solution since we need to use constant space and our loop here is disobeying that. 
We can build up on what we already have and not use a for loop but swap intermediate elements while checking their values. We can achieve this by using two pointers `i` and `j`. `i` will be our slowest pointer while `j` the fastest. 
Let's construct this logic bit by bit:
```python
def move_zeroes():
  length=len(nums)
  # print(length)
  i=j=0
```
So we first get the length of our array and store it in a variable. Then we initialize our pointers and assign them to 0 to begin with. After that we can:
```python
def move_zeroes():
  length=len(nums)
  # print(length)
  i=j=0
  while j < length:
    if nums[j]==0:
      j +=1
    else:
      nums[i],nums[j]=nums[j],nums[i]
      j +=1
      i +=1
  print(nums)
```
So we are going to keep track of `j` our fastest pointer. As long as it is within the length of our array:
1.We check its value if it is equal to zero. If it is we move the pointer position forward by 1. 
2.If `j` is not zero then we swap `j` and `i` then move each of them forwards. 
3. We then return our initial array.

If we run that logic the stats are:
![stats](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbacaf534j3ody3pnx7x.png)
Which is decent if anything is to go by. 
Thanks for reading through and see you on the next one.
Need help tooltip
Published: 2021-08-04 16:57:15

I want position of tooltip center like bellow
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odp61bkjm0mg2910ne15.png)

But I can't do that. Anyone help me solution. Thanks !!!
Bellow is mine 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/90hx76vxiub9vucfswkj.png)

```------------HTML-----------------
<div class="right-menu">
            <button class="tool-tip" data-tooltip="Search">
                <i class="fas fa-search"></i>
            </button>


            <button class="tool-tip" data-tooltip="Cart">
                <i class="fas fa-shopping-cart"></i>
            </button>

            <button class="tool-tip" data-tooltip="My Account">
                <i class="far fa-user"></i>
            </button>

            <button class="tool-tip" data-tooltip="Setting">
                <i class="fas fa-sliders-h"></i>
            </button>

            </div>

-------------------CSS-----------------------


.right-menu button {
   display: inline-block;
   padding: 10px;
   border: 0;
   cursor: pointer;
   position: relative; 
   background-color: transparent;
   text-align: center;
   margin: 0 auto;
   align-items: center;
   justify-content: center;
}

button::before {
    content: attr(data-tooltip);
    background: #ccc;
    position: absolute;
    top: 50px;
    padding: 5px;
    width: 100px;
    border-radius: 10px;
    transition: .5s linear ; 
    visibility: hidden;    
}

button:hover::before {     
   transform: translateY(-80%) ;
   visibility: visible;
}

```
https://codepen.io/uydung-the-styleful/project/editor/AgoVKe
¿Qué es Frappe Framework?
Tags: spanish, frappe, python, lowcode
Published: 2021-08-04 16:38:49

## Introducción

[Frappe](https://frappeframework.com/) es un web framework **low code** y open source en Python y Javascript. Su origen comienza con [ERPNext](https://erpnext.com/) y luego con lo robusto que se fue haciendo deciden crear Frappe Framework con todas las funcionalidades que tiene ERPNext pero aplicadas a la creación de apps robustas y todo a nivel low code. En el mismo framework se puede modificar o crear funcionalidades específicas que se necesiten usando Python o Javascript.

Mi intención es ir armando una guía en español para aprender a usar este framework, ya que hasta incluso su propia documentación en inglés no es muy amigable a la hora de explicar muchas cosas. Varias las aprendí a los golpes o tocando por todas partes porque ni en sus guías eran específicos. Por eso quise escribir esta guía y con lo que aprendi compartirlo con todos, porque es increíble como ahorra mucho tiempo de desarrollo este framework. Quedé sorprendido como en tan poco tiempo logré sacar una app funcionando perfectamente con un front aparte que se comunica con su propia REST API que ya ofrece Frappe. Una app simple que si hubiera programado tanto backend como front de cero hubiera tardado el doble o quizas hasta el triple.

Este artículo lo iré actualizando con los links de las guías que vaya sacando y es posible que lo vaya modificando haciendo correcciones por si algo no se entiende para ir mejorándolo, ya que es la primera vez que armo una guía y seguro que cometa algún error.
Primero arrancaríamos con la creación de un entorno local en docker para luego empezar un tutorial creando una app de cero con Frappe, tratando de abarcar todo lo que se usa de Frappe y que también termine resolviendo varias de las dudas que tuve y no pude encontrar en su documentación.

## Tutorial

1. [Creando un entorno local con Docker](https://dev.to/aleher/creando-un-entorno-local-con-docker-3em8)
Svelte is Here to Stay
Tags: svelte, podcast, javascript
Published: 2021-08-04 16:21:14

{% spotify spotify:episode:3jqLiNzt82MF5JeBPktoON %}

## What is HTML All The Things

HTML All The Things is a [web development podcast](https://podcast.htmlallthethings.com/) and [discord community](https://discord.com/invite/jweMCx9) which was started by Matt and Mike, developers based in Ontario, Canada. 

The podcast speaks to web development topics as well as running a small business, self-employment and time management. You can join them for both their successes and their struggles as they try to manage expanding their Web Development business without stretching themselves too thin.

## What's This One About?

In this episode Matt and Mike discuss Svelte, a JavaScript framework that compiles when you build your app. Other frameworks like Vue and React do a lot of their work in the browser, Svelte's compile step does that work instead. The duo discuss Mike's impressions of Svelte and where it's going in the future, followed by Matt's recent introduction to Svelte and JavaScript frameworks in general.

## Show Notes

3:30 - What is Svelte
6:20 - Comparison of Svelte vs Vanilla JS
10:55 - What makes Svelte different from Vue & React?
14:28 - What are the advantages of Svelte?
25:00 - Matt's journey in learning Svelte

##Key Takeaways

* It's really easy to pickup and learn Svelte vs Vue and React. It has clear and clean syntax and no boilerplate. 
* Svelte is a word. Of a person slender and elegant.
* Refer to the documentation of Svelte before googling. This can help avoid using pure vanilla JS solutions when Svelte can do something like hiding and showing a div easier. 

## Resources 
* [https://dev.to/joshnuss/svelte-compiler-under-the-hood-4j20](https://dev.to/joshnuss/svelte-compiler-under-the-hood-4j20) 
* [https://deepu.tech/what-about-svelte/](https://deepu.tech/what-about-svelte/) 
* [https://krausest.github.io/js-framework-benchmark/current.html](https://krausest.github.io/js-framework-benchmark/current.html) 

## Thank you!

If you're enjoying the podcast consider giving us a review on [Apple Podcasts](https://podcasts.apple.com/us/podcast/html-all-things-web-development-web-design-small-business/id1412209136) or checking out our Patreon to get a shoutout on the podcast. 

**[Support us on Patreon](https://www.patreon.com/htmlallthethings)**

You can find us on all the podcast platforms out there as well as

[Instagram (@htmlallthethings)](https://www.instagram.com/htmlallthethings/)
[Twitter (@htmleverything)](https://twitter.com/htmleverything)
[TikTok (Html All The Things)](https://www.tiktok.com/@htmlallthethings)
Software developers for startup - Fully remote
Tags: startup, job, vacancy, fullstack
Published: 2021-08-04 16:04:10

Torre Labs is looking for a Software developers for fast growing start-up 🚀 🌎 fully remote.

Skills: 3+ years of Web Development, Full Stack development, 2+ years of Software architecture.
Language required: English - Conversational.
Location: Remote.
Compensation: USD$50.000 /year.

Applying through Torre is super simple, using the following link: https://torre.co/s/dRumJWqtCf

Don't have a torre.co account yet? No worries. I can help you set it up and then submit the application for you. Cool, huh?

Reach out to me to lmedina@torre.co with your CV and email if you’d like my help.
Best Chrome Extension Which can help you while you are coding.
Published: 2021-08-04 15:50:04

I have seen some of the article on google chrome extensions and as usual sharing it with you guys


As a designer/developer we use google chrome in daily life. That's why I brought the top 10 google extensions to make your work easy, We have a modern browser that is always upgraded by developers. I have brought 10 browser extensions today that will help you in coding.

[8 Best Google Chrome Extensions for Web Designers And Developers in 2021](https://cmsinstallation.blogspot.com/2021/04/10-best-google-chrome-extensions-for.html)


As developers, I can bet that you already have a nice collection of daily go-to tools. After all, they are there to make your life easier and improve productivity. Chrome is pretty awesome with built-in tools and matching it with these Chrome extensions will only make developers’ lives that little bit easier. This is why I have collected some of Anima’s engineer teams’ favorite Chrome extensions and put them together to share with you.

[5 essential Chrome extensions for developers](https://www.animaapp.com/blog/industry/5-essential-chrome-extensions-for-developers/)


A couple of months ago, we reviewed the new Firefox browser designed for developers. Since then most of our developers kept Google Chrome as their primary browser. Working with Chrome offers access to an immense repository of Chrome extensions and tools which make our daily tasks less of a chore. With the built-in developer tools, there seems to be no further need for more tools. However, I’d like to present you with 16 of the best Google Chrome extensions for developers.
[16 extremely useful Chrome extensions for developers](https://usersnap.com/blog/chrome-extensions-for-developers/)

If you’re a developer, you will likely already have a collection of favourite Chrome extensions you use on a daily basis. Extensions that make life easier, make you more productive or perform an essential task better than a dedicated tool. This list may build on that collection.

[28 of the Best Chrome Extensions for Developers in 2021](https://wpastra.com/chrome-developer-extensions/)