teleren/devto huggingface dataset:
The server reached maxrequestworkers setting, consider raising the maxrequestworkers setting.
Tags: mysql, programming, webdev
Published: 2020-12-19 18:01:57

If you are encountering this error it does not mean that anything is wrong with your Apache or Apache MaxRequestWorkets settings. You can not make any changes to Apache. This error means that one of your apps has a slow PHP script or receiving a huge number of requests that your PHP script is unable to answer requests as quickly as they are coming.

---
title: originally posted here 👇
canonical_url: https://kodlogs.com/blog/1957/reached-maxrequestworkers-setting-consider-maxrequestworkers
---

#Reason for this error:
PHP can execute a limited number of requests for each app. If the PHP script is executing very slowly even with a small amount of traffic then your limit has been reached. When the number of queued requests for PHP becomes too large then you see “Server reached MaxRequestWorkers setting” error message.

##Identifying a slow PHP script:
In this situation, look at your apps PHP slow log that is located at;
`
/srv/users/serverpilot/log/APPNAME/APPNAME_phpX.Y.slow.log
`
Here X.Y is the version of PHP on which your app is running for example php5.6.

Identify a large amount of traffic to a PHP script:
If you are unable to see any slow requests, then you need to check your apps PHP access log at;
`
/srv/users/serverpilot/log/APPNAME/APPNAME_phpX.Y.access.log
`
This will be used when you are receiving a large number of requests that you cannot expect.
Keep footer at bottom of page - using flexbox
Tags: css, flexbox, footer
Published: 2020-12-19 17:32:02

**TLDR** - at the end. *But I urge you to read ahead if you'd like to understand the concept*.  

Have you run into this problem where the footer on your site does not stay at the bottom of the page, even if it is the last tag in your html body. 

Especially if you are new to web development, you'll run into this problem. There are ways of making sure your footer stays at bottom, but most of those methods have some kind of caveat.  
- Position: absolute (*doesn't work when there's more content, you'll realise footer is stuck and your content is scrolling behind it*).
- Position: fixed (*use only if you want your footer to be always visible*).  
  
---
![Preview footer problem](https://dev-to-uploads.s3.amazonaws.com/i/301957v1quawlgw19fju.png)  

---  

There's a way using **flexbox** which works on device of every size, doesn't require fixed height of navbar or footer, and works without any side-effects.  

### Reset browser defaults
If you are not using any css frameworks, you should reset some browser default css. Otherwise your browser will apply its own margin and padding to page.
```css
  /* following style will be applied to every element */
  *, *::before, *::after{
     margin: 0;
     padding: 0;
     box-sizing: border-box; 
  }
  /* write your own css after this part */
```

### Structure of page
Your html body should follow this kind of structure. You can use `<div>` instead of `<main>`.
```html
<body>
  <div class="pagewrap">
    <nav>...</nav>
    <main>...</main>
    <footer>...<footer>
  </div>
</body>
```
*basically wrap all content of your page inside a div, give it some classname*

### Using flexbox
Add display:flex and flex-direction:column to you main div (which contains all other elements of page). You also need to make that div take full height of viewport. see below code:
```css
  .pagewrap{
    display: flex;

    /*vertically stack children*/
    flex-direction: column;

    /* expand to take full height of page */
    /* min-height overrides both height & max-height */
    min-height: 100vh; 
   
  } 
```

---

![Concept of flexbox column](https://dev-to-uploads.s3.amazonaws.com/i/ab2t1at5qwfz4rxovnee.png)  

---  

Now all you need to do is stretch the <main> element to take as much height as possible. Use flex-grow to do this.
```css
  main{
    flex-grow: 1;
  }
```
--- 

![Final output](https://dev-to-uploads.s3.amazonaws.com/i/aobsnwd3hz9z00yuv49o.png)

---

**TLDR** : 
- Wrap all of your body elements inside a div.
- Give that div a display: flex, flex-direction: column and min-height: 100vh;
- Wrap elements other than navbar and footer inside a div/main tag.
- Give that div/main tag a flex-grow: 1;

That's it! As you can see in above picture, it works even if you have less content or more content. You don't have to worry about making it responsive.
JavaScript Guide 
Tags: javascript, webdev, beginners
Published: 2020-12-19 17:20:52

In this article I'm going to go over my most recent project - JavaScript Guide. The intention of this guide is to help beginner developers ace advance their Frontend knowledge and ace their interview questions.

From basic to advanced: test how well you know JavaScript, refresh your knowledge a bit, or prepare for your coding interview! 

![ezgif com-gif-maker](https://user-images.githubusercontent.com/48876996/102694409-4d754700-423a-11eb-9615-af0f6e70d450.gif)

## Demo

Link to the repo 👇
https://github.com/Adrinlol/javascript-guide

## Table of contents

This projects covers all the important concepts of JavaScript along with several examples.

Some key topics included in this tutorial are:
 
- [Introduction](https://adrinlol.github.io/javascript-guide/#Introduction)
- [Variables](https://adrinlol.github.io/javascript-guide/#Variables)
- [Constants](https://adrinlol.github.io/javascript-guide/#Constants)
- [Scope](https://adrinlol.github.io/javascript-guide/#Scope)
- [Objects](https://adrinlol.github.io/javascript-guide/#Objects)
- [Arrays](https://adrinlol.github.io/javascript-guide/#Arrays)
- [Comparison](https://adrinlol.github.io/javascript-guide/#Comparison)
- [Closure](https://adrinlol.github.io/javascript-guide/#Closure)



<figcaption>
Note: This is just a part 1/n of this project, I'll be updating it regularly to include as many concepts as I can. </figcaption>
How to Upload files to S3 in a C# ASP .NET Core App
Tags: csharp, aws, s3
Published: 2020-12-19 17:17:02

The instructions in this article are designed for a C# ASP .NET MVC application. They should work elsewhere are with tweaks for your situation. This assumes that your AWS creds are already setup. It's based on <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-5.0">a Microsoft article about file uploads</a> with tweaks for the s3 upload.

### Add dependency
Add the NuGet module AWSSDK.S3 to your project

### Add the data class
Create a file with this content
```csharp
using Amazon;
using Amazon.S3;
using Amazon.S3.Transfer;
using System;
using System.IO;
using System.Threading.Tasks;

namespace YOUR_NAMESPACE
{
    public class S3Upload
    {
        private static readonly RegionEndpoint bucketRegion = RegionEndpoint.EUWest2;
        private static IAmazonS3 s3Client;

        public static async Task UploadFileAsync(Stream FileStream, string bucketName, string keyName)
        {
            s3Client = new AmazonS3Client(bucketRegion);
            var fileTransferUtility = new TransferUtility(s3Client);
            await fileTransferUtility.UploadAsync(FileStream, bucketName, keyName);
        }
    }
}
```

### Add a new modal
Add a new modal called FileUploadFormModal.cs to your project with this content

```csharp
public class FileUploadFormModal
{
    [Required]
    [Display(Name="File")]
    public IFormFile FormFile { get; set; }
}
```

### Add a view
Create a view called FileUploadForm.cshtml with this content in Views/Home

```html
@model FileUploadFormModal
<form enctype="multipart/form-data" method="post">
    <dl>
        <dt>
            <label asp-for="FileUploadFormModal.FormFile"></label>
        </dt>
        <dd>
            <input asp-for="FileUploadFormModal.FormFile" type="file">
        </dd>
    </dl>
    <input asp-page-handler="Upload" class="btn" type="submit" value="Upload">
</form>
```

### Edit HomeController.cs controller
Add a using statement for the data class and add the following code to the HomeController.cs

```csharp
public async Task<IActionResult> FileUploadForm()
{
    return View();
}

[HttpPost]
public async Task<IActionResult> FileUploadForm(FileUploadFormModal FileUpload)
{
    using (var memoryStream = new MemoryStream())
    {
        await FileUpload.FormFile.CopyToAsync(memoryStream);

        // Upload the file if less than 2 MB
        if (memoryStream.Length < 2097152)
        {
            await S3Upload.UploadFileAsync(memoryStream, "YOUR_BUCKET_NAME", "YOUR_KEY_NAME");
        }
        else
        {
            ModelState.AddModelError("File", "The file is too large.");
        }
    }

    return View();
}
```
What I've learned from building my portfolio !
Tags: webdev, codenewbie
Published: 2020-12-19 17:15:37

I've been thinking about making my portfolio for a while but wasn't sure if I should actually do it because I didn't have anything to showcase <i> but then I was challenged to make my portfolio in <b>3 days </b></i> and accepted it.

Considering my full time job it was pretty challenging for me but I've learned some stuff : 

<h3> 1. I need to make more projects. </h3>
After coming up with the structure of my portfolio I thought I could build it without struggling too much but it turned out it was rather hard to apply my knowledge properly!
So myy focus should be on building/recreating easy stuff first, get comfortable with it and then move on to the next level.

<h3>2. I need to Get better at googling. </h3>
As we all know googling is a must have skill. 
While making my portfolio I came across some problems which I didn't know how to put them into words and Google them therefore it led me to spending lots of time on playing around with css to find out how to solve/fix my problems on my own. 
This could have been avoided and would have saved my time if I could just Google it. 

<h3> 3. Criticism can be very useful/helpful . </h3>
Getting nice and positive feedback sure feels great but (in my opinion) getting criticism is far better .
You may ask why?  
Because they will help you see your flaws and work on them to improve.

<h3> 4. I need to be more confident in my work. </h3>
When I showed the demo version of the portfolio to my friends, they said it looks cool. 
This may sound stupid but I thought they only said it because they're my friends and didn't want to make me feel bad about my work. 
But the truth is they'd considered my knowledge ( I mean how much knowledge I have) and with that in mind they said it's cool.
Obviously I don't have as much experience as a developer who's been working for a long time, so when someone compliments my work I should just take it and be happy about the fact that they liked my work and think I'm getting better at what I do.
<i>But bear in mind that just because your friends like your work, it doesn't mean it's perfect. </i>


<br>
These were the lessons I'd learned from making my portfolio which was very valuable. So if you haven't made yours yet, I suggest you get on with it. it might teach you some valuable lessons as well.

_________________________________________
A preview version of portfolio is available on my twitter. You can check it out <a href="https://twitter.com/nazanin_ashrafi/status/1339901716737765377?s=19"> <i>here</i> </a>
Any feedback would be appreciated! 🙏🙏
Cleaning up merged git branches
Tags: tutorial, git, cli
Published: 2020-12-19 17:03:58

If you use any git workflow such as [git flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow), you end up with several branches like feature, release and *hotfix* that become stale as they are merged with other branches.

So, when you need to look for a specific branch using the `git branch` command, you could waste time skimming through a big list of branch names.

One way to handle that is to use `git branch --merged`, which lists only the branches that have already been merged, and then copy the name of each one and delete them with `git branch -d branch-name`. That works fine if you do that every time you merge a branch, but if you're like me, you'll quickly forget to do this, and once you realize it, you'll have several branches on the list again.

Now, to remove all merged branches at once, we can use the following command:

```sh
git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d
```

This will remove all branches that have been merged with exception of master and develop. You can even create an alias to in your shell environment to not have to type or copy that every time you need it.

> Careful with the -d flag. If you change it to  -D (capital case), you might end up removing unmerged branches and losing hours of work
useState with objects (what the hack!!)
Tags: react, webdev, hooks, state
Published: 2020-12-19 17:02:37

**Popular Questions**

**1.)**How do useState behaves while taking the **initial state** as an **object**?

**2.)**Why do we make use of **spread operator** while dealing with the objects as the initial state?  

*Here's the solution!!*

![useState with object eg](https://dev-to-uploads.s3.amazonaws.com/i/gjfpa8pb2o9r5y9k0d15.JPG)

After running the above code, we get the output as follows:

a.)
![useState with object opt](https://dev-to-uploads.s3.amazonaws.com/i/w412h7hzbqgv6l8qep38.JPG)

b.)
![useState with object opt](https://dev-to-uploads.s3.amazonaws.com/i/bs11lc8gnt0pco2ifbt7.JPG)
 
We can clearly see that while entering the first name, the last name gets disappear from the Heading and vice versa.

But why is it happening? why are not we able to see both the first name and last name simultaneously?

**Reason:**
This is happening because useState **does not** automatically merge and update the object (contrary to setState while using class-based components) i.e. useState does not merge the state automatically.
We have to do it manually with the help of **spread operator**. 

Solution:
 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y7jwpz5b84fp574s9wr8.JPG)

Output:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u6wktu9pow5nox9am1zj.JPG)

Here we get our actual output!!

**Happy coding!!**
*-Jayant Khandelwal*

<a href="https://www.buymeacoffee.com/jackent2b" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
JIRA tutorial for all
Tags: jira
Published: 2020-12-19 16:48:00

The holidays is a time to relax with the family but also to try and make that New Years resolution come true before the year ends. I know 2020 was.... special, but I did promise myself I will do some youtube this year. In that regard will try to make a JIRA tutorial in this time. 

Update - The series is finished and is awailable below

https://www.youtube.com/playlist?list=PLNQq42pqd-rxJC0fh6nBAw8KAfEG5PgtS

#jirasoftware #youtubechannels
[cli] ContentCli : 10000 articles en une seule commande
Tags: blog
Published: 2021-03-18 11:39:13

---
title: [cli] ContentCli : 10000 articles en une seule commande
published: true
date: 2020-12-19 16:22:12 UTC
tags: Blog
canonical_url: 
---

![](https://coderparlerpartager.fr/images/contentcli-joomla-3.png)

Salut super joomlers!

Vous avez  un site joomla de test et vous souhaitez créer des articles d'exemple en masse en une seule commande

Découvrez [ContentCli](https://github.com/alexandreelise/file_contentcli "ContentCli - Créez 10000 articles en une seule commande grâce à ce script cli pour Joomla! 3")un petit script cli créé pour Joomla! 3 permettant  de créér jusqu'a 10000 articles en une seule commande
JavaScriptmas Solutions
Tags: javascriptmas, scrimba
Published: 2020-12-19 16:10:53

Hi! 🖐
My name is Ezequiel.
I've been learning JavaScript for a couple of years and when I found out that Scrimba was having a JavaScriptmas Advent Calendar I signed up right away.

Challenges are a great way to flex that coding muscle and learn some new methods you were not familiar with. 

One of my favorite challenges was the **The Rolling Dice**. It seems easy but it had me thinking of a way to show all Dice faces using just plain CSS.

Another challenge I enjoyed was **Carousel**. The tricky part was trying to get the carousel to start at the correct position when it reaches the end of the array.

Here is the list of all the #JavaScriptmas Challenges:

Day 1. [Candies](https://scrimba.com/scrim/coea74feaa38737da78a0a55e)
Day 2. [Deposit Profit](https://scrimba.com/scrim/cof054fac93cd8a73c52ee44d)
Day 3. [Chunky Monkey](https://scrimba.com/scrim/co223424f80b8399986e4d482)
Day 4. [Century From Year](https://scrimba.com/scrim/co5a74e1abdedc3428b034a0b)
Day 5. [Reverse a String](https://scrimba.com/scrim/co6b44c828a4727d00fac7027)
Day 6. [Sort by Length](https://scrimba.com/scrim/cob5f40b1b98ee57ca213cef8)
Day 7. [Count Vowel Consonant](https://scrimba.com/scrim/co17843e08556cdf3eaccb97a)
Day 8. [The Rolling Dice](https://scrimba.com/scrim/co76045eeafb391516e7aa002)
Day 9. [Sum Odd Fibonacci](https://scrimba.com/scrim/co32c49aebe16aea78d5078b6)
Day 10. [Adjacent Elements Product](https://scrimba.com/scrim/cof1d490b8dee9e41a9d07c37)
Day 11. [Avoid Obstacles](https://scrimba.com/scrim/cobe24c5a99ffd48116727221)
Day 12. [Valid Time](https://scrimba.com/scrim/co180427c9d2d128952fb1564)
Day 13. [Extract Each Kth](https://scrimba.com/scrim/co3384f03bf81c62085991543)
Day 14. [Maximal Adjacent Difference](https://scrimba.com/scrim/co66d42e2958d95ec3cbe7080)
Day 15. [Carousel](https://scrimba.com/scrim/co1834759aa1fd419672ef99c)
Day 16. [Insert Dashes](https://scrimba.com/scrim/codd1483eb0fe340342dde61f)
Day 17. [Different Symbols Naive](https://scrimba.com/scrim/co0f14a9da0951ab90f8413e6) - [using Set](https://scrimba.com/scrim/co3b942009120d42109f96662)
Day 18. [Array Previous Less](https://scrimba.com/scrim/coa6a4ce28053ea3d3179fc2d)
Day 19. [Alphabet Subsequence](https://scrimba.com/scrim/co1044616838538fd9a1738af)
Day 20. [Domain Type](https://scrimba.com/scrim/co1124967a86ac79e07a95a51)
Day 21. [Sum of 2](https://scrimba.com/scrim/co4c24fcd9df8d395ebd8f369)
Day 22. [Extract Matrix Column](https://scrimba.com/scrim/co3dc45d3a87957273cb0e98e)
Day 23. [Social Media Input](https://scrimba.com/scrim/co5c64084b50f6cfdbb3cabc8)
Day 24. [Test Your Agility](https://scrimba.com/scrim/co7e94b75939ecfd78ccc5b6a)

What a ride! I loved all these challenges! 
Good luck to all those you participate in the Contest!

<span style="font-family:Papyrus; font-size:4em;">Photo by <a href="https://unsplash.com/@punttim?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tim Gouw</a> on <a href="https://unsplash.com/s/photos/christmas-background?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
Exploring GraphiQL and adding Netlify Contentful Webhook
Tags: webdev, netlify, graphql, contentful
Published: 2020-12-19 16:10:00

Adding my [old portfolio site](https://github.com/wizlee/portfolio) as one of the project in my [current portfolio site](https://wizlee.dev/) took much less time than expected. Thus, quickly proceed with the stretch goal mentioned in previous post. 

First, proceed with triggering Netlify deploy whenever content is published in Contentful. The steps are well stated in [this netlify blog post - Automate Contentful Deploys With Netlify Webhooks](https://www.netlify.com/blog/2020/04/24/automate-contentful-deploys-with-netlify-webhooks/).

Then, I continue with exploring the [Gatsby GraphiQL explorer](https://www.gatsbyjs.com/docs/how-to/querying-data/running-queries-with-graphiql). Despite some getting used to at the start, got the graphql query for dev.to articles to work quickly by using the gatsby-source-dev gatsby plugin. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0xkx114a89ym5v7pro3l.png)

The cover image of this post shows the graphql query that will be used to automatically show my latest articles in wizlee.dev. Next is to implement these as a static query!
Common JavaScript Tips
Tags: javascript, programming, webdev
Published: 2020-12-19 16:09:12

Bellow, I will explain you some popular JavaScript mistakes

## Use const/let instead of var

Replace old fashioned `var` with new `const`, that will guarantee you better condition of your code.

```js
// bad

var a = ‘foo’

var b = ‘bar’

// good

const a = ‘foo’

const b = ‘bar’

```

If you really need to change variable use `let`, it’s like `var` but `let` has block range, var has functional range.

What is block variable?

**Block variable** you can read only in defined block of code where was defined.

```js

for(let i = 0; i < 10; i++) { 

  let j = 10

  console.log(j)

  //variable j range

}

console.log(j) //ReferenceError: i is not defined

```

**Functional variable** you can read inside whole function not only in the code block.

```js

for(let i = 0; i < 10; i++) { 

  var j = 10

  console.log(j) // 10

}

console.log(j) //10

```

Both `let` and `const` are in block range.

---

## Use Template Literals

Manually joining string with `+` it’s terrible, it’s bad for refactoring and code readability. The best way for joining words is Template Literals.

If you earlier joined words like that, read this chapter.

```js
const name = ‘Maciej’

console.log(‘Hello ‘+ name + ‘, wave’)

```

Now I’ll compare the old method with Template Literals.

```js
const name = ‘Maciej’

console.log(`Hello ${name}, wave`)

```

It’s more clear, right?

In Template Literals you can easily add new lines with only just enter button.

```js
const name = ‘Maciej’

console.log(`Hello ${name}

,wave`)

```

---

## Copy array with spread operator

I think every one of us sometimes must copy the array, but only half of us know about spread operator.

```js
const array = [1,2,3,4,5]

//bad

const newArray = []

for(let i = 0; i < array.length; i++){

  newArray[i] = array[i]

}

//good

const newArray = [...array]

```

[Reference on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax)

---

## Conditional operators

Every one of us sometimes must or want to use conditional operators from some reasons, sometimes you want to save a couple of lines or make the code cleaner.

```js
const a = 0

let b = 0

!a ? b = 1 : b = 2

```

Like you see on the above snippet, this is not perfect code it's looks weird.

Below you will see easier way.

```js
b = !a ? 1 : 2

```

Tadam! Looks better, right?



Thanks for reading 🙏

---

Changelog:

**07/22/2020**

Added:

* Use const/let instead of var 

* Use Template Literals

* Copy array with spread operator

* Conditional operator

If you like this article, please follow me on Twitter [@MaciejDEV](https://twitter.com/MaciejDEV)


---

Photo by NeONBRAND on Unsplash
[presentation] Mot de passe super admin oublié? Super Cli à la rescousse!
Tags: blog
Published: 2021-03-18 11:39:38

---
title: [presentation] Mot de passe super admin oublié? Super Cli à la rescousse!
published: true
date: 2020-12-19 15:36:44 UTC
tags: Blog
canonical_url: 
---

![](https://coderparlerpartager.fr/images/super-cli-joomla-3.png)

Salut super joomlers!

Vous oubliez votre mot de passe super admin encore et encore?

Vous galérez avec des requêtes SQL pour le réinitialiser?

Découvrez dès maintenant [SuperCli](https://github.com/alexandreelise/file_supercli "SuperCli un script cli pour Joomla! 3 pour réinitialiser votre mot de passe super admin")

Voici ci-contre la présentation qui accompagne la [vidéo](https://youtu.be/Tjbjh3dhcqE "Vidéo sur SuperCli le script cli qui permet de réinitialiser votre mot de passe super admin dans Joomla! 3").
Santa's Christmas Wishlist
Tags: exercise, kata, dojo, watercooler
Published: 2020-12-19 15:22:09

Christmas is coming, and I created a small coding exercise for you that focuses on Object-Oriented Design and delivering presents to every child!

The code kata is called Santas's Christmas Wish List and you can clone the description from my GitHub.

{% github sandordargo/santas-christmas-wishlist %}

If you like it, feel free to star and share the repo!

Merry Christmas!