teleren/devto huggingface dataset:
Mantiqiy operatorlar | logic operators
Tags: beginners, programming, linux, uzbek
Published: 2022-03-31 16:30:11

### Binary
> **Binary** - operator deb 2 ta obyekt qabul qiladigan operatorlarga aytiladi.
Masalan: `+` yoki `-` operatori faqat 2 ta obyekt ustida ishlatiladi.

### Unary
> **Unary** - operator esa faqatgina 1 ta obyekt qabul qiladi.
Masalan: `!` operatori 1 ta obyekt ustida ishlatiladi.**!True**

### `True` va `False` mantiqiy qiymatlari
- `true`- qiymat deb rost/to'g'ri/mavjud qiymatlarga aytiladi.
- **true** - ko'p dasturlash tillarida `0` dan boshqa qolgan 
barcha qiymatlarni qabul qiladi.
- `False` - yo'q/yolg'on/noto'g'ri qiymatga aytiladi.

> **True** - 184 , 777, 0.001 , -17.
> **False** - 0

### AND - &&
- > Binary
- True/False mantiqiy qiymat qaytaradi
- Ikkala holatda ham **true** bo'lsa, `true` qaytaradi.


|    A    |    B    |   `&&`   |
| ------- |:-------:| --------:|
| false   | false   |**false** |
| true    | false   |**false** |
| false   | true    |**false** |
| true    | true    |**true**  |

### OR - ||
> - Binary
>
>> - Logik true/false qiymat qaytaradi
>
>>> - Kamida 1 ta obekt `true` bo'lsa **true** qaytaradi

----------------------------------
|    A    |    B    |   `OR`   |
| ------- |:-------:| --------:|
| false   | false   |**false** |
| true    | false   |**true**  |
| false   | true    |**true**  |
| true    | true    |**true**  |


### XOR - `^`
> - Binary
>
> - Logik true/false qiymat qaytaradi
>
> - obyektning mantiqiy qiymatini teskarisini qaytaradi.


|    A    |    B    |   `^`   |
| ------- |:-------:| -------:|
| false   | false   |**true** |
| true    | false   |**false**|
| false   | true    |**false**|
| true    | true    |**true** |

### `NOT` - `!`
> - unary
>
> - Logik true/false qiymat qaytaradi
>
> - obyektning mantiqiy qiymatini teskarisini qaytaradi.


|    A    |   `!`   |  
| ------- |:-------:| 
| false   |**true** |
| true    |**false**|
How to create a beautiful table of contents on Hashnode
Tags: writing, tutorial, programming, design
Published: 2022-03-31 16:25:16

## What is table of contents ToC

To put it simply, tables of contents are crucial part of each blog post that lets your readers quick access to parts of the information they want, fast. 

When using Markdown, the default approach would be to use [unordered list](https://www.markdownguide.org/basic-syntax/#unordered-lists) with [enclosed links](https://www.markdownguide.org/basic-syntax/#links) which looks good but could be better.

## How to make new fancy table of contents on Hashnode

![toc_01](https://user-images.githubusercontent.com/78694043/161037124-6dd040bb-df8c-4a45-91aa-601cd26a5411.gif)

As you can see, Hashnode generates table of content from `<h2>`or `<h3>` headers and nesting them nicely.

### How to preview table of contents on Hashnode

![toc_02](https://user-images.githubusercontent.com/78694043/161098670-600c1931-16c3-4001-8445-60ae5ffc0182.gif)

## How to create table of contents in Markdown 

To create basic table of contents in Markdown you would use:
1. Unordered list.
2. Enclose the link text in brackets so when you click on the text it will just to the content.

```lang-none
- [Example](#first-example)
- [Example2](#second-example)
- [Third Example](#third-example)
- [Fourth Example](#fourth-example)

... some text

## Example
## Example2
## Third Example
## Fourth Example
```

![image](https://user-images.githubusercontent.com/78694043/161040781-a64b4455-8ff8-4a5d-b5f3-9a4cbc39ca14.png)


## Conclusion 

Make it convenient for your reader. If the reader wants immediately jump to a piece of code, give him the opportunity to do so. Let your readers decide what to read and pay attention to what is important to them, in case the order does not need to be followed.

By the way, if you're looking for a programmatic data extraction solution from Google (PlayStore, Maps, Images, YouTube..), Yahoo!, Naver, Bing and so on, [have a try SerpApi](https://serpapi.com) 👀
React <video> autoPlay solution
Tags: webdev, react
Published: 2022-03-31 16:22:46

**Hello, DEV community!**

Today I was struggling with a video element in a react app. I was trying to insert an video to a website that would play looped in the background. 

That would require adding `autoPlay`, `loop` and `muted` attributes to the video tag like here:
```
// App.jsx //

import mutedVideo from './media/muted_vid.mp4'
import './App.css';

function App() {
  return (
    <div className="App">
      {/* VIDEO */}
      <video autoPlay muted loop>
        <source src={mutedVideo} />
      </video>
      {/* //VIDEO */}
    </div>
  );
}

export default App;
``` 

For some reason during source code bundling, React keeps ignoring `muted` attribute. So the final outcome in production looks like this:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68tu4emub9tkarvudol6.png)

After a while of research and browsing Stack Overflow, I learned that it is a common issue in React that still hasn't been solved for years!

I've also found a workaround solution to overcome this bug. The solution is creating my own `Video` component:

```
// components/Video.jsx //

export default class Video extends Component {
  state = {
    html: "",
  };
  componentDidMount() {
    const src = this.props.src;
    const html = `
        <video autoPlay muted loop>
            <source src=${src} />
        </video>
      `;
    this.setState({ html });
  }
  render() {
    return <div dangerouslySetInnerHTML={{ __html: this.state.html }}></div>;
  }
}
```

This component takse `src` of a video as a prop and returns a `<div>` with directly injected `<video>` tag and it's attributes.

Here's App code with new Video component:

```
// App.jsx //

import mutedVideo from "./media/muted_vid.mp4";
import Video from "./components/Video";
import "./App.css";

function App() {
  return (
    <div className="App">
      {/* VIDEO */}
      <Video src={mutedVideo} />
      {/* //VIDEO */}
    </div>
  );
}

export default App;
```

Now this gave me result that I expected in production output:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vfqsg72bn6m6v76fov3.png)

As an effect, the video can be easily played in the background.

**IMPORTANT NOTE!** `dangerouslySetInnerHTML` is not called "dangerous" for no reason. Even though it is safe to use it in this particular case, in many other cases it should not be used unless you really know what you're doing :). [Here](https://blog.logrocket.com/using-dangerouslysetinnerhtml-in-a-react-application/) is more detailed article about this property.

Did you happen to deal with such an issue? Please share your story in the comment section.

Happy coding!

Follow me on [Twitter](https://twitter.com/WojnickiAdam)
Day 1
Tags: html, css, registration, login
Published: 2022-03-31 16:18:41

---
title: Day 1
published: true
description: Simple
tags: HTML, CSS, registration, login  
//cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6lqzpq78bo7xtqoydmym.png
---
### Create Login and Registration page

Souce code can be found on [github](https://github.com/brixmavu/100-Days-of-Code/tree/main/day1)

### Technologies used

Bash - HTML - CSS - JavaScript

Create a project folder

> `mkdir project`

Enter project folder

> `cd project`

Create project files

> `touch index.html style.css script.js`

From code editor explorer open index.html

Inside index.html file paste Sticky Footer code from [mdn github repo](https://raw.githubusercontent.com/mdn/css-examples/main/css-cookbook/sticky-footer--download.html)

Rearrange code 

Add new heading :

> 100 days of code

Add copyright to footer

> &#169; 2022

Add login and registration forms inside index.html file [forms](https://gist.github.com/brixmavu/fd3ed94769a0a788bd0525ca170251ab)

I have added a video check the banner which is audio-less it's due to the fact it got heavy on my PC. I'm using the xbox game bar app on Windows.  The focus is to show how I went about my solution in 8 minutes [Day 1. Session 1. YouTube](https://youtu.be/xajheVmU1xk)
Gathering Subscription access information with PowerZure
Tags: azure, pentest, cloudsecurity
Published: 2022-03-31 16:04:42

---
title: Gathering Subscription access information with PowerZure
published: true
description: 
tags: Azure, Pentest, CloudSecurity
//cover_image: https://direct_url_to_image.jpg
---
*Test at your own risk

1.In an Az PowerShell module-authenticated PowerShell session on your machine, download PowerZure using the following commands:
```
PS C:\> cd C:\Users\$env:USERNAME
PS C:\> git clone https://github.com/hausec/PowerZure.git
```
Output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5dhxwy58o0onoay6sxd.PNG)

2.Import the PowerZure module into your PowerShell session with the following commands. If prompted to install the Azure AD module, type Y and press Enter. Close and re-open the PowerShell console:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ichkz8n71qzz6pmpci91.PNG)

3.If you installed the Azure AD module, open a new PowerShell session and use the following commands to re-import PowerZure into the PowerShell console.
```
PS C:\> cd C:\Users\$env:USERNAME\PowerZure
PS C:\> Import-Module .\PowerZure.ps1
```
After the module is imported, it will list your current role (Reader) and available subscription. This is useful reconnaissance information.
- AADRoles: Shows the role that the current user is assigned in Azure AD
- AzureRoles: Shows the Azure RBAC role assignments and scopes for the user.
- Available Subscriptions: Shows the subscriptions that the user has some level of permission to. This information is useful to see whether there are opportunities to move laterally to other subscriptions using this user account.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/psnjisby51248v8rpr18.PNG)

4.To see a list of all the available functions in PowerZure, run the following command.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5svjbls2gk20fe5uawh.PNG)

5.Part of enumerating the attack surface area is determining the actual access that a credential had and its level of access(read/write/execute). PowerZure had a function called Get-AzureTargets that we can use for this purpose. This function compared the user role to the Azure scope to make this determination. You can run the function using the following command.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fp727bq3o8wjn1sp1jj.PNG)
While the Get-AzTargets function of PowerZure is a great way to understand the scope of access that a user has, and the resources that they have access to, MicroBurst also collects this information into flat files for the review of an entire subscription. Each tool has its own benefits, and different situations will call for different tools.

**Reference:**
https://github.com/PacktPublishing/Penetration-Testing-Azure-for-Ethical-Hackers
Enhance FreeRTOS with Luos: Allow you to develop your projects using microservices
Tags: freertos, luos, microservices, systems
Published: 2022-03-31 15:58:24

You develop your edge or embedded systems with FreeRTOS? We develop a connection with Luos to make microservices.
⏩ https://docs.luos.io/tutorials/freertos/intro
Discover the features of Luos without changing the way you design your system.

Luos works as an IPC between your boards, learn how on this tutorial.
Bit Maze - Platformer Maze
Tags: codepen, gamedev, javascript, showdev
Published: 2022-03-31 15:35:48

<h1>Bit Maze - Platformer Maze</h1>

<h2>Description</h2>

<p>Guide Appley to find the sprout in this weird dungeon.</p>

<p>You may use your keyboard, or the controller at the screen to move Appley to another position.</p>

<p>This weird dungeon have so many traps, be careful of them!</p>

<p>Also please don't look at the source code (Especially the map!) before playing this game. That's cheating!</p>

<h2>Controls</h2>

<p>Up arrow key or Space bar - To jump</p>

<p>Left arrow key - To move to the left</p>

<p>Right arrow key - To move to the right</p>

<h2>Development</h2>

<p>This game is actually based on the unfinished game I tried to do before. I couldn't continue that, because I thought that I needed so many resources and algorithms to develop that game. I didn't use any game engines nor libraries for that game.</p>

<p>I used Phaser to create this game. I can't split codes from here, so all the codes are just compressed into a single scene. The assets are from Aseprite. The default colour palette used by Phaser is ARNE16, so I also used that colour palette to draw these images.</p>

<p>The main character I used for the game before is a dinosaur, but I decided to change the character into an apple (hence the name of the character is Appley).</p>

<h2>Resources</h2>

<ul>
<li><a href="https://phaser.io">Phaser</a> - The game engine or framework.</li>
<li><a href="https://www.aseprite.org">Aseprite</a> - Tool for creating pixel art.</li>
<li><a href="https://fonts.google.com/specimen/VT323">VT323</a> - Font</li>
<li><a href="https://lospec.com/palette-list/arne-16">ARNE 16</a> - Colour palette</li>
</ul>

{% codepen https://codepen.io/takaneichinose/pen/jOYPjgz %}
Start doing better code reviews tomorrow: The emoji code
Tags: programming, codereview, beginners, tutorial
Published: 2022-03-31 15:30:11

---
canonical_url: https://juandavidvega.es/2022/03/30/start-doing-better-code-reviews-tomorrow-the-emoji-code/
series: Developer Good Habits
---

One of the software engineer’s main activity nowadays is providing peer feedback about code, but giving written feedback is hard. You mainly face two issues:

- Keep it short and straightforward.
- Keep your intention clear.

## It's all about your intention

We work with other people, and we usually don't want to hurt them or make them feel overwhelmed. To help here, and inspired by [a Microsoft post](https://devblogs.microsoft.com/appcenter/how-the-visual-studio-mobile-center-team-does-code-review/), we introduced the **emoji code for reviews** within our team.


> Make your comment intention crystal clear with an emoji.


At the beginning of each comment, you include an emoji that express your intention with that comment.

## Our code

There are several public examples: [Code Review Emoji Guide](https://github.com/erikthedeveloper/code-review-emoji-guide), [My Code Review Emoji Guide](https://brendanforster.com/notes/my-code-review-emoji-guide/) and [Emoji Code Review Comments](https://gist.github.com/chrisriesgo/818fe94b4f4720eaf7898ccaa48f94c5). In my team we use the following one:

- 👍: I love this part and want to praise it!
- ❓: I have a question or need some insights to understand this part.
- 🐛: This is a potential bug. You must provide a detailed explanation and, if possible, a suggested change.
- 🤡: A matter of taste, it doesn't affect quality, but from the reviewer's point of view, it will improve code
- 💭: Not action required. I want to share a thought, to seed an idea for a future debate. Even not an answer is required.
- ♻️: Propose a refactor to simplify or improve a code block. The suggested change is required at least as pseudo-code.

It is short, and you can memorize it at first sight. Anyone can understand what it means, even without checking the legend.

## Next step

You can start using this independently or start by proposing any of the existing examples to your team. Don't add too many emojis to the code. Make it easier to remember and be pragmatic.

[Photo from Pexels](https://www.pexels.com/photo/emoji-designs-of-golf-balls-on-the-grass-6572958/)
[Conceito] - SLA/SLI/SLO
Published: 2022-03-31 15:11:16

> Conteúdo original [nessa thread to twitter](https://twitter.com/zanfranceschi/status/1506670349575991306).

---

\#bolhadev,

Vcs já ouviram falar daquelas paradas de SLA/SLI/SLO?

SLA é mais comumente falado (contratos geralmente falam nisso).

Aquele monte de 99.999%, 5 noves, 4 noves, 99.98% etc?

Puta confusão, né? Cola aqui, ó.

cc @sseraphini
 
🧵👇

---

SLA: Service Level Agreement (procure sobre os outros dois)

É basicamente garantia de funcionamento baseada em métricas (disponibilidade, tempo de respostas, etc).

Ex: Garanto que minha API estará disponível 99,99% por mês. Ou seja, posso ficar até 4m e 22s fora do ar.

---

Quando o serviço não compre o SLA, penalidades, multas, etc. são aplicadas. E essas coisas ficam no contrato – claro.

A fórmula pra calcular o SLA é super simples:

![img](https://pbs.twimg.com/media/FOjC0s6XsAUIUx7?format=png&name=360x360)

---

Zueira! Só entrar nesse site aqui pra calcular ó: [https://uptime.is](https://uptime.is)

Ele te dá a conversão de e para porcentagem e tempo. Por exemplo, pra vc saber quanto de porcentagem são 10 minutos. E vice-versa.

---

Não vou indicar materiais específicos pq não tenho muita expertise na área. Mas se quiser se aprofundar procure por SRE, SLA, SLI, SLO. É um assunto muito interessante!

Chegou até aqui? OMG!, dá um abraço aqui 🫂
[Conceito] - Testes de Performance: Carga & Stress
Published: 2022-03-31 15:10:19

> Conteúdo original [nessa thread to twitter](https://twitter.com/zanfranceschi/status/1508634952572747783).

---

\#bolhadev,

Se você cansou desse assunto do tapão na noite do Oscar, cola mais e vem discutir sobre testes de carga e stress! Você sabe a diferença? Tem diferença, na verdade?

mmm…

🧵👇

cc @sseraphini

![img](https://pbs.twimg.com/media/FO-0opOXoAI6Igx?format=jpg&name=large)

---

Na verdade, testes de carga e stress estão sob a categoria de testes de performance, mas falemos apenas sobre carga e stress, ok? Estes 2 são os mais confundidos entre si.
Apenas para curiosidade, outros testes de performance são de volume, estabilidade, endurance, pico, etc.

---

Vamos pegar o exemplo do diagrama abaixo, onde é enviada uma série de requisições de teste para um sistema ao ponto deste não mais responder da forma desejada (falha) por quem o requer. 

Pois é, este tipo de teste (é, o cara testou o outro, vai?) é chamado de TESTE DE STRESS.

![img](https://pbs.twimg.com/media/FO-1IdtXsAYLqyF?format=jpg&name=4096x4096)

---

TESTE DE STRESS (stress test) é usado para se descobrir o ponto de falha de um sistema ─ até onde ele aguenta. É um teste de descoberta.

---

O TESTE DE CARGA (load test) tem um propósito um pouco diferente. Serve para COMPROVAR que um sistema suporta determinada carga.

Imagine um carro em que seu manual diz suportar 1000kg de carga. A gente vai lá, mete 1000kg de carga e testa ─ deveria aguentar.

![img](https://pbs.twimg.com/media/FO-4ESjWYBMcltj?format=jpg&name=small)

---

Existem fatores comuns aplicáveis para os dois tipos de testes:

- DURAÇÃO: Por quanto tempo executar o teste;

- VARIABILIDADE: De tempo: 5mins com X requisições/seg; 20mins com Y requisições/seg; pausas. De conteúdo: variar o que se envia.

---

Uma parte difícil destes testes é o ambiente: ter um ambiente produtivo ou equivalente.

Na 1ª opção, vc corre o risco de alterar dados produtivos.

Na 2ª opção, vc corre o risco de não ter um ambiente equivalente de verdade ao de produção (não vale testar em dev ou homolog).

---

Outro ponto importante é que geralmente as ferramentas para os dois tipos de testes podem ser as mesmas. O que diferencia a execução de um tipo para o outro é mesmo sua configuração.

Algumas ferramentas:

- K6
- JMeter
- Gatling
- Apache Benchmark (ab)
- Load Runner
- Etc

---

Eita, chegou até aqui? 🥲

Muito obrigado pela moral! Dá um abraço aqui ó 🫂

Foi bom dar um tempo no assunto do tapa, né? hihihi
📢 Cloud 66 Prepress v2 Release
Tags: jamstack, staticsites, cloud
Published: 2022-03-31 15:08:09

[Cloud 66 Prepress](https://www.cloud66.com/frameworks/static-sites/) is a No Ops tool for deploying static sites. These are the changes that went out with a latest release:

- **More cloud providers**

Prepress now supports Digital Ocean, Google Cloud, Microsoft Azure, and Linode as well as AWS. With this wide range of cloud providers, you have more options for deploying your site as well as benefitting from lower prices for your storage and traffic.

- **Import from Netlify**

Prepress now detects if your site uses Netlify redirect files and automatically imports all your redirect and rewrite rules into your new site, with every deployment.

- **LiveLogs**

Requests to your Prepress sites can be monitored in real-time. LiveLogs include not just host and path, but also the visitor's IP address, ISP, country, city, browser, OS, and other user agent information with high accuracy.

- **Secure by default**

All sites deployed with Prepress are now protected by SSL certificates from day one, including full and simple support for custom domains.

- **More frameworks**

Prepress now supports more frameworks: Jekyll, Hugo, Gatsby, Next.js, Vue.js, Nuxt.js, Svelte, Middleman, and Docusaurus v1 and v2 and we will be adding even more soon.

- **Prepress Webflow**

Webflow is a completely new way to control traffic before it reaches your site.

Using Webflow rules, you can not only redirect and rewrite traffic based on paths or domains but also based on the country of origin, type of OS or browser, or even the internet service provider that your visitors use! With Webflow, you can send traffic from Italy to an Italian version of your site, traffic from mobile devices to a mobile-friendly site, and traffic from Apple computers to a version of the site that's tailored for Apple OS X.

Here are some examples:

```
 Block {
   when: origin.country_code == "GB" ||
   inRange(origin.ip, "86.10.40.0/24") ||
   request.user_agent.client.family == "Chrome",
   message: "Use a different browser when connecting from the UK",
 }
```

```
 Redirect {
   from: "^/",
   to: "/mobile/apple/",
   with: permanent,
   when: request.user_agent.os.family == "iOS",
 }
```

Webflow uses Common Expression Language (CEL) to provide maximum flexibility to control the flow of traffic to your websites. By building Webflow on top of CEL, we have built the foundation of many more great features to come this year.

*Note*:  [Help doc: Using Webflow rules to route traffic](https://help.cloud66.com/prepress/how-to-guides/deployment/using-webflow-rules-to-route-traffic.html)

- **Pricing 🎉🎉🎉**

Static sites are important, but shouldn't break the bank. You shouldn't be paying more, just because you want your marketing team to update your site. That's why Prepress pricing is simple and affordable. Each Prepress site costs $1.99 per month + $0.095 per GB of outbound traffic, that's it!

Deploy Happy!
Blockchain in Go
Tags: go, blockchain, distributedsystems, beginners
Published: 2022-03-31 15:06:40

As I continue to learn Go, I wanted to combine it with another thing that interests me. Blockchain. 
Blockchain is not a new concept, it started with the hype around bitcoin.

I am not a crypto fanatic but I do want to know exactly what goes on under the hood. 

I started by reading the paper, [Bitcoin: A Peer-to-Peer Electronic Cash System](https://bitcoin.org/bitcoin.pdf). I had to re-read it, while I jumped on other blog posts and videos on YouTube until it made some sense. No, I don’t understand it completely but enough that I could start a transaction.

But for now, I would rather stick to the developer perspective. So I set out to find a way to make the blockchain. Go was the choice here as I also found a few resources which give out samples on building blockchain in Go.[Resource](https://blog.logrocket.com/how-to-build-blockchain-from-scratch-go/)  

So here is the link to my GitHub for Blockchain in Go.[Blockchain-In-Go](https://github.com/sumant1122/Blockchain-In-Go) 

What is unique is this also shows the code to mine the block. Perhaps the most confusing part of Bitcoin was mining for me. Mind that we are only referring to blockchain and not any sort of crypto coins in the code. 

I am not an expert here but I did figure out that a lot of things can be added to make the existing code more modular. Adding database, but which one do I need to figure out. Do we also use cache? Can we make a blockchain that is scalable, make it a microservice? I am still figuring things out and this is just the beginning. 

If you are interested leave a comment here or suggest changes on my GitHub. We are working here to learn something new.