teleren/devto huggingface dataset:
O fim do suporte da Microsoft ao PHP
Tags: php, microsoft, programacao, braziliandevs
Published: 2020-07-19 02:11:55

O título do artigo pode parecer pretensioso ou talvez assustador para programadores novatos, mas vamos apenas refletir um pouco sobre a atual situação do PHP neste contexto.

_“No entanto, não ofereceremos suporte ao PHP para Windows em qualquer capacidade para a versão 8.0 e posterior”
Dale Hirt
Service Engineer — Microsoft_

A notícia, de 09 de julho de 2020, de que a Microsoft estaria deixando de dar suporte ao PHP 8.0 deixou muita gente surpresa e também com “medo” pois perde um apoio significativo. Então, agora o PHP morre? Todo ano nos deparamos com esta pergunta, seja em artigos ou em fóruns e grupos pela Internet. Isso se deve pelo fato da linguagem ser muito amada e também muito odiada por muitos programadores pelo mundo.

![Stack Overflow via Tecnoblog](https://dev-to-uploads.s3.amazonaws.com/i/nx8pr9p088ad7nj7aqpr.png)
_Stack Overflow via Tecnoblog_

Mas, fique tranquilo, não há motivos para pânico! O fim do suporte da Microsoft ao PHP significa que a empresa não estará compilando e aplicando as correções de segurança na versão para Windows a partir da versão 8.0. Entre as compilações que a Microsoft faz estão os arquivos “php.exe” e “mod_php7.dll”, por exemplo, além dos outros oficiais encontrados em https://windows.php.net. Também, não significa que o PHP deixará de rodar no Windows nativamente. Muita gente já está cogitando usar o PHP em Linux através de máquinas virtuais para continuar programando na linguagem através do Windows.

_“Esta mensagem NÃO significa que ninguém o fará.”
Sara Golemon
PHP contributor_

Uma contribuidora do PHP, Sara Golemon, (SaraMG no Twitter), acalmou o ânimo de alguns aflitos no reddit. Ela afirma o que muitos já esperavam. Apesar de não saberem ainda o que farão, pois ainda estão assimilando a notícia, ela explica que a própria comunidade deve absorver essa demanda, possivelmente alocando alguma máquina para processos automatizados para compilar o que for necessário. E, finaliza dizendo que provavelmente pouco mudará para os usuários do Windows.

Sugiro que dê uma lida nas referências desse artigo para saber mais. Está tranquilo agora? Espero que sim, pois, o PHP como muitas outras linguagens populares, não vai morrer da noite pro dia, tem evoluído constantemente e tem uma comunidade muito forte! Espero que tenha gostado do artigo, me siga para mais artigos sobre PHP e outras linguagens e também outras tecnologias.

##Referências:

Microsoft: We're pulling the plug on Windows builds of programming language PHP
https://www.zdnet.com/article/microsoft-were-pulling-the-plug-on-windows-builds-of-programming-language-php/

Microsoft Support of PHP on Windows
https://news-web.php.net/php.internals/110907

Microsoft Announces that it will drop official support of PHP on Windows
https://laravel-news.com/microsoft-dropping-php-support
More readable conditional with Array.includes()
Tags: javascript, productivity, codequality, typescript
Published: 2020-07-19 02:08:02

Do you know the function `Array.includes()` of the JavaScript? This function was specified in ES7 and is capable of making a conditional much more readable.

This function determines is the parameter is contained in the array.

```js
const numbers = [1, 2, 3, 4]
const strings = ['Gabriel', 'Rufino']

numbers.includes(3) // true
numbers.includes(6) // false
strings.includes('Rufino') // true
strings.includes('Fernando') // false
```


Knowing this function, you can now write more readable conditionals that compare a variable with many possibilities by replacing large chains of `or` operator (`||`) with `Array.includes()` using a variable as the parameter. See the example:

### Using `or` operator

```js
function get(request, response) {
  const access = request.access

  if (access === 'maintainer' || access === 'admin' || access === 'developer') {
    return response.json({ allowed: true })
  } else {
    return response.json({ allowed: false })
  }
}
```

### Using `Array.includes()`

```js
function get(request, response) {
  const access = request.access

  if (['maintainer', 'admin', 'developer'].includes(access)) {
    return response.json({ allowed: true })
  } else {
    return response.json({ allowed: false })
  }
}
```

## Works with `NaN`

```js
NaN === NaN // false
[1, 2, 3, NaN].includes(NaN) // true
```

Thanks!
Day 48 : #100DaysofCode - Code Along
Published: 2020-07-19 02:00:23

How do you learn code? Personally, I am a visual and "hands on" coder/person. What that means is that I can not just watch a Youtube video, I need to code along with it. I like to code along and then look at the documentation for things that I do not understand. I am not sure how others code, but I would love to know if there are others out there like me. 

Today I began a code along for creating a MVC todo application using Ruby on Rails. 

Here is the repo so far: 

{% github SincerelyBrittany/todo-mvc-lv-codealong no-readme %}

If you are new to code and new to rails, feel free to take a look. 

Thanks for reading!

Sincerely,
Brittany
A PWA app to view all EXIF data of your .jpeg or even .heic files!
Tags: productivity, vue, webdev, showdev
Published: 2020-07-19 01:53:03

Hi everyone!

In this post, I will introduce you my new created website, [EXIF Viewer](https://exifviewer.netlify.app), it's a PWA app to let you view all EXIF data of your `.jpeg` or even `.heic` image files.

## What is EXIF

EXIF i.e. Exchangeable image file format, is a standard that specifies the formats for images, sound, and ancillary tags used by digital cameras (including smartphones), scanners and other systems handling image and sound files recorded by digital cameras.

It will include some informations when your camera take photos:

- Make, like: Apple for iOS
- Model, like: iPhone 8
- GPS*, will include the latitude and longitude
- Date time, like: 2020:06:25

etc.

## Why to build this website

Privacy is becoming more and more important in our daily life, as we see in above, an image may(or may not) include many EXIF data that may expose your mobile model, your GPS location etc.

One can know from an image that WHEN the time you use WHAT camera(mobile) at WHERE location took this image.

It's not good for privacy.

## How to use this website

It's simple enough and I just put 2 screenshots in here and sure you will know.

![Before you select an image](https://dev-to-uploads.s3.amazonaws.com/i/9dg7eh7rgmj0h7vu9esq.png)

![After you select an image](https://dev-to-uploads.s3.amazonaws.com/i/i2krmr8sonl4h0825rmr.png)

Easy, right?

## What's next

In the next few releases, I will provide the EXIF data striping so you can download the image with no EXIF data, for privacy.

## Another words

1. The website will not upload your image to anywhere, it's just in your computer and in your browser

2. Not all the images include EXIF data and even an image does, it may not include all the EXIF data, that's another reason you will need this website.

3. It's on GitHub.

{% github jwenjian/exif-viewer no-readme %}

If you found this useful, just give it a ✨ or [buy me a coffee](https://www.buymeacoffee.com/jwenjian)

OK, see you in my next post.
Hello ! Need Help
Published: 2020-07-19 00:49:08

Hello everyone !  I created "componentDidUpdate()" for check my localStorage. If I receive a token, my state change but it's didn't work ...

componentDidUpdate(prevState) {
          
        const propsConnexion = this.props.connexion;
       // const connexionFalse = this.props.connexion === false;
       //const connexionTrue = this.props.connexion === true;
        if(propsConnexion !== prevState.propsConnexion){
                
               if(localStorage.getItem("jwt") !== null) {
                   
                   this.props.connexion(true)
                   console.log(this.props.connexion)

                }

               else{
                  console.log( this.props.connexion)
                   this.props.connexion(false)
                } 

            }      
    }
การตั้งข้อรังเกียจผู้พิพากษา
Tags: judge
Published: 2020-07-19 00:11:30

---
title: การตั้งข้อรังเกียจผู้พิพากษา
published: true
description: ตั้งข้อรังเกียจผู้พิพากษา เพื่อเปลี่ยนองค์คณะในการพิจารณาคดี
tags: Judge
---

การตั้งข้อรังเกียจผู้พิพากษา เป็นเหตุหนึ่งที่จะทำให้มีการเปลี่ยนแปลงองค์คณะในการพิจารณาพิพากษาคดีได้ โดยคู่ความสามารถทำได้สองวิธีคือ

1. คู่ความยื่นคำร้องต่อศาลนั้น คัดค้านตัวผู้พิพากษาเพื่อให้ผู้พิพากษาท่านนั้นถอนตัวไป
2. คู่ความยื่นคำร้องต่อประธานศาล หรืออธิบดีศาล ให้เรียกคืนสำนวนคดีจากผู้พิพากษาท่านนั้น

โดยเหตุแห่งการยื่นคำร้องคู่ความอาจอ้างว่า ผู้พิพากษาที่เป็นอาค์คณะในการพิจารณาคดีนั้น น่าจะมีส่วนได้เสียในคดีนี้ เข้าข้างฝ่ายใดฝ่ายหนึ่ง หรือด่าคู่ความฝ่ายหนึ่งจนมากเกินไป

หรือเพราะเหตุจากการรับสินบน เกี่ยวข้องเป็นญาติกับคู่ความฝ่ายหนึ่ง หากเป็นองค์คณะต่อไปจะเสียความยุติธรรม

ซึ่งหากการยื่นคำร้องสองวิธีข้างต้นยังไม่ได้ผล ก็อาจฟ้องร้องผู้พิพากษาท่านนั้นเป็นคดี เพื่อเป็นข้ออ้างว่ากำลังมีคดีพิพาทกับผู้พิพากษาท่านนั้น ก็จะมีเหตุในการตั้งข้อรังเกียจคัดค้านผู้พิพากษา

วีธีการมีอยู่ ทั้งนี้ก็ขึ้นอยู่กับผู้เลือกใช้แล้วละครับ ว่าจะใช้เพื่อประโยชน์ส่วนตนในการประวิงคดี หรือใช้เพื่อผดุงความยุติธรรมครับ
Get complete system info using shell commands
Tags: linux, bash, todayilearned
Published: 2020-10-17 15:12:10

---
title: Get complete system info using shell commands
published: true
date: 2020-07-19 00:00:00 UTC
tags: linux,bash,til
canonical_url: https://bhupesh-v.github.io/complete-system-info-using-shell-commands/
---

Below are a bunch of easy one-liner commands that give information about various aspects of your Linux machine.

### Memory Used/Total

```bash
free -h | awk '/^Mem:/ {print $3 "/" $2}'
```

### Show CPU temperature

```bash
sensors | awk '/^Core*/ {print $1$2, $3}'
```

### Most Memory Intensive processes

```bash
ps axch -o cmd:15,%mem --sort=-%mem | head
```

### Most CPU Intensive processes

```bash
ps axch -o cmd:15,%cpu --sort=-%cpu | head
```

I [wrote a small shell script](https://github.com/Bhupesh-V/.Varshney/blob/master/scripts/sys.sh) to get _(almost)_ realtime update of your system.

```bash
#!/usr/bin/env bash

# Realtime system info
#
# Use: watch -ct -n0 sys.sh
# 
# TODO:
# 1. Netspeed 
# 2. Open ports ?


# color definitions
RESET=$'\e[0m'
BOLD_GREEN_FG=$'\e[1;32m'
BOLD_WHITE_FG=$'\e[1m'

## RAM Usage
ram=$(free -h | awk '/^Mem:/ {print $3 "/" $2}')

## Show CPU temperature
temperature=$(sensors | awk '/^Core*/ {print $1$2, $3}')

## Most Memory Intensive processes
mem_intensive=$(ps axch -o cmd:15,%mem --sort=-%mem | head)

## Most CPU Intensive processes
cpu_intensive=$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)


pc_uptime=$(uptime -p | awk '{for (i=2; i<NF; i++) printf $i " "; if (NF >= 1) print $NF; }')

printf "%70s\n\n" "${BOLD_WHITE_FG}System Monitor${RESET}"

printf "\n%s\n" "${BOLD_GREEN_FG}RAM :${RESET} $ram"

printf "\n%s\n\n" "${BOLD_GREEN_FG}CPU Temperature 🌡 : ${RESET}"
printf "%s\n" "$temperature"

printf "\n%s\n\n" "${BOLD_GREEN_FG}Most Memory Intensive Processes${RESET}"
printf "%s" "$mem_intensive"

printf "\n\n%s\n\n" "${BOLD_GREEN_FG}Most CPU Intensive Processes${RESET}"
printf "%s\n\n" "$cpu_intensive"
```

Here is a quick demo of how this looks like

![sys-demo](https://user-images.githubusercontent.com/34342551/96346219-5cb00b00-10b8-11eb-90fb-d21f6ffa7c12.gif)


The `watch` command handles the "realtime" aspect, it can be used to perform operations like running a certain command periodically.
The `-c` flag enables the watch to render ANSI colors.
The default interval for the `watch` command is _2_ seconds but can be configured using the `-n` option.

Save the above script and use it like this:

```bash
watch -ct -n0 sys.sh
```

If you have any other ideas, drop them below 👇

> Seems interesting?, [Subscribe 🚀](https://buttondown.email/bhupesh) to receive more such cool stuff or just connect with me on [twitter](https://twitter.com/bhupeshimself).
Symbol type in JavaScript - Part 2
Tags: javascript
Published: 2020-07-19 00:00:00

---
  title: Symbol type in JavaScript - Part 2
  published: true
  tags: JavaScript
  date: Sun Jul 19 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/symbol-javascript-part-2
  cover_image: https://melvingeorge.me/_next/static/images/main-b872f74c259a04ffa40086f421046cc1.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/symbol-javascript-part-2)
  
We looked at the very basics of `Symbol` datatype in Javascript in our [previous blog post](https://melvingeorge.me/blog/symbol-javascript-part-1).

There we have discussed how to add the `Symbol` datatype to an object and reading the value of the `Symbol`.

## Symbol Literal

Just like we added a `Symbol` using the bracket notation to an object we can add `Symbol` directly to an object.

We need to use the `[]` (bracket) notation inside the object like this.

```javascript
// create a symbol
const id = Symbol("id");

// an object
const obj = {
  id: 23,
  [id]: 23,
};
```

### NOTE: Don't put the symbol `id` inside quotes, pass the reference of the created symbol.

## Not shown by `for...in` loop

The Symbols on an object will not be shown in a `for...in` loop.

```javascript
// create a symbol
const id = Symbol("id");

// an object
const obj = {
  id: 23,
  [id]: 23,
};

// for...in loop
for (let prop in obj) {
  console.log(prop, obj[prop]); // Symbol types are not shown
}
```

Now, if you want to know if any `Symbol` types are present you can use the `Object.getOwnPropertySymbols()` method.

```javascript
// create a symbol
const id = Symbol("id");

// an object
const obj = {
  id: 23,
  [id]: 23,
};

// get all symbols present in an object
const symbols = Object.getOwnPropertySymbols(obj);

console.log(symbols);
```

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

---
Powershell 7 Debugging Secret
Tags: powershell, productivity, debug
Published: 2020-07-18 23:57:10

---
title: Powershell 7 Debugging Secret
published: true
tags: powershell, productivity, debug
canonical_url: https://erickguillen.dev/post/powershell-debuging-secret/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/awpzprnza1dj4vxya8nu.png
---

Powershell 7 introduced a new feature that not many people on the internet seem to know yet.
I'm talking about `-ErrorAction` mode `Break`

This new error action mode allows you to start a debugging session at the time a script reaches an error. Sounds easy right? Let's try it out! 

Disclaimer: I usually haven't use the debugger, I'm one of those that usually start running commands one by one on the console to see where the code breaks 😅. But I think its time to grow up and start debugging like a pro and this new feature makes debugging a lot easier!

First, let's create a function that will have an error which we will need to fix.

```powershell 
function Divide-function{
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [int]
        $Number
    )
    process{
        return $Number/0 
    }
}
```
We will save our function in a `Divide-function.ps1` file and open a Powershell session and dot source it `. ./Divide-function.ps1`

Then we run our function for the first time and let's we what happens 
```powershell
PS> Divide-Function 2
RuntimeException: C:\Scripts\Divide-Function.ps1:9
Line |
   9 |          return $Number/0
     |                 ~~~~~~~~~
     | Attempted to divide by zero.
```

WOW an ERROR! Now let's try to debug it

```powershell
PS> Divide-Function 2 -ErrorAction Break
Entering debug mode. Use h or ? for help.

At C:\Scripts\Divide-Function.ps1:9 char:16
+         return $Number/0
+                ~~~~~~~~~
```


Easy as that, now we are debugging exactly where our code failed! 

You can use this opportunity to explore the debugger on your own from here. I advise you to start with the PowerShell advice and use `h` or `?` for help.

```powershell

 s, stepInto         Single step (step into functions, scripts, etc.)
 v, stepOver         Step to next statement (step over functions, scripts, etc.)
 o, stepOut          Step out of the current function, script, etc.

 c, continue         Continue operation
 q, quit             Stop operation and exit the debugger
 d, detach           Continue operation and detach the debugger.

 k, Get-PSCallStack Display call stack

 l, list             List source code for the current script.
                     Use "list" to start from the current line, "list <m>"
                     to start from line <m>, and "list <m> <n>" to list <n>
                     lines starting from line <m>

 <enter>             Repeat last command if it was stepInto, stepOver or list

```

Do you want to know more about PowerShell Debugger: [about_Debuggers](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_debuggers?view=powershell-7)
useDependentState - React useState hook with dependencies
Tags: react
Published: 2020-07-18 23:56:13

I've been using React hooks for a bit and have found several cases where I've needed `useState` to update when the initial value changes. The typical pattern I've used is something like this:

```typescript
const [value, setValue] = useState(fromValue);

useEffect(() => {
  setValue(fromValue);
}, [fromValue]);
```

I initially disliked that the value gets set 2x on the first render, so I had sometimes opted to initialize the state to null or undefined.

```typescript
const [value, setValue] = useState(null);

useEffect(() => {
  setValue(initialValue);
}, [initialValue]);
```

The downside of this is that an extra render occurs when state gets set in the `useEffect` callback. It turns out that this is not the case when setting the value in both places, since the `setValue` call won't trigger a re-render if the state has not actually changed.

I'm a big fan of breaking out custom hooks when possible to keep components cleaner, more testable, etc., so I decided to do so here.

```typescript
export function useDependentState<D>(
  dependency: D
): [D, (data: D) => void] {
  const [state, setState] = useState<D>(
    dependency,
  );

  useEffect(() => {
    setState(dependency);
  }, [dependency]);

  return [
    state,
    setState,
  ];
}
```

This also has the benefit of being reusable. It will probably become a hook I use in most of my apps.
Binary Search
Published: 2020-07-18 23:27:49

Today I'll be going over binary search, a search algorithm that finds the position of a target value in a sorted array. 

It works by repeatedly halving the portion from the list that could contain the item until you land on the intended target. We start from the middle of the list and depending on the condition, we manipulate the range to eliminate a half of the list. 

Let's take a look at a classic binary search problem: Find an element position in a sorted array. We have the target element and we want to return the index/position of it. 

```js
const binarySearch = (arr,target) => {

    let left = 0
    let right = arr.length - 1
    let boundary_index = -1

    while(left <= right){
        let mid = left + Math.trunc((right - left) / 2);
        if(arr[mid] === target){
            return mid
        }
        if (arr[mid] < target) {
            left = mid + 1;
        } else {
            right = mid - 1;
        }
    }

    return -1
}
```
The way we implement binary search is by first creating the range in which the element could reasonably be. In this while loop, we are constantly searching the middle element of the array and checking for three things:

1: Is the current element the target? If it is, we return the index. 

2: Is the current element smaller than the target? If it is, we know that everything to the left of this element cannot be the target. Therefore, we make the left boundary of the range **mid + 1**. 

3. Is the current element larger than the target? If it is, we know that everything to the right of this element cannot be the target. Therefore, we make the right boundary of the range **mid - 1**. 

We can assume these things because the array is sorted in ascending order. The values become larger as we go to the right of the list. If we never find the index, we return -1.
Learn, Share, Inspire - My 1st YouTube Channel Interview 📹(KnowledgeIndia)😊🎓👨‍💻📚💭🏃🎯🤖
Tags: aws, career, linux
Published: 2020-07-18 23:11:45

<b> Thanks to <a href="https://www.youtube.com/user/knowledgeindia"> KnowledgeIndia</a></b><b> YouTube Channel for the invitation to share my personal experience and journey so far</b>

<i>Shared my personal experience to motivate people, specially the ones who are beginners and would like to start their career in Cloud Computing :)</i>
📹😊🎓👨‍💻📚💭🏃🎯🤖

<b><a href="https://www.youtube.com/user/knowledgeindia">Watch it out here</a></b>
[![Interview with Cloud Professionals - DINESH RATHEE - EP 05](http://img.youtube.com/vi/QKn1qTs9KIo/0.jpg)](https://www.youtube.com/watch?v=QKn1qTs9KIo)

<ul>
<li><b><a href="https://www.linkedin.com/feed/update/urn:li:activity:6689896122548334592/"> LinkedIn Post </a></b></li>
</ul>

![YouTubeLogo](https://dev-to-uploads.s3.amazonaws.com/i/ce5ggbeum5decjlfx4g3.JPG)
<b><a href="https://www.youtube.com/user/knowledgeindia">📹 KnowledgeIndia </a></b> is a great resource to get started with cloud, I'll share some of my favorite playlist / videos
<ul>
<li><a href="https://www.youtube.com/watch?v=YQ-re9KxuoE&list=PLTyrc6mz8dg9pAQQ8BV8vZRIt9_h09Ggp">AWS Tutorials for Beginners | BEST & EASY AWS Video Tutorial</a></li>
<li><a href="https://www.youtube.com/watch?v=pOal0uCrEaA&list=PLTyrc6mz8dg_tg1o1Calg8TOTuXclrGg4">AWS ECS in simplest terms - Elastic Container Service | EC2 Hosted & Fargate hosting</a></li>
<li><a href="https://www.youtube.com/watch?v=tD9vDv0uyI8&t=589s">AWS - VPC Demo, Public & Private Subnets, Route Tables, Internet & NAT Gateways</a></li>
</ul>

<b>You can connect with me</b>
<ul>
<li><b><a href="https://www.linkedin.com/in/%E2%80%8Bdineshrathee12" target="_blank">LinkedIn</a></li>
<li><b><a href="https://dev.to/dineshrathee12" target="_blank">DevTo</a></li>
<li><b><a href="https://github.com/dineshrathee12" target="_blank">GitHub</a></li>
<li><b><a href="https://twitter.com/dinesh_rathee12" target="_blank">Twitter</a></li>
</ul>

![Keep Learning](https://media.giphy.com/media/SUnMaL8C9Vr37kX4x0/giphy.gif)
Docker Compose - MariaDB
Tags: docker, mariadb, tutorial, mysql
Published: 2020-07-18 22:58:05

Sabe quando você tem que subir um banco de dados pra fazer uma api ou só rodar um projeto na sua máquina e não quer perder todo aquele tempo instalando e configurando na sua máquina?

Outro dia tive que fazer isso e tive um trabalhinho então quis compartilhar aqui para caso alguém precise não demore quase uma hora com um erro porque colocou as variáveis de ambiente errado :sweat:

Esse é um script que fiz para usar com o docker-compose, então caso não tenha ele instalado é só ir no site do docker e instalar eles tem um guia bem legal de como instalar.

Então depois de instalado é só colocar esse script dentro de um arquivo '_docker-compose.yml_' e rodar o comando '_docker-compose up' na pasta onde está o arquivo que ele já vai estar rodando na porta 3306 que inclusive pode ser alterada assim como as variáveis de ambiente ali em baixo.

Espero que tenha te ajudado e xau :v:

``` elixir
version: "3"
services:
    bancoMariaDb:
        image: mariadb
        restart: always
        container_name: bancoMariaDb
        ports:
            - "3306:3306"
        volumes:
            - .:/code
        environment:
            - MYSQL_USER=friends
            - MYSQL_ROOT_PASSWORD=friends
            - MYSQL_DATABASE=friends
```