teleren/devto huggingface dataset:
Auditing a website for beginners!
Tags: seo, beginners
Published: 2021-02-16 05:09:31

Auditing a website can and should be utilized when you want to look at the four components of a site; SEO, Accessibility, Performance and best practices. All of these attributes can help show how a site is truly functioning. Today, I am going to give a tutorial on how to perform an audit on a site I use often, Etsy.com using web.dev, WAVE and Lighthouse. These three sites were created for the purpose of being able to see SEO, Accessibility, Performance and best practices while also providing solutions to areas scored below 100. The website WAVE, however, mostly focuses on accessibility whereas the other two cover the four components in depth! 

In my video I explain the four components and what they are as well as three areas for improvement I personally feel Etsy could fix for their users. The first area of improvement is tied in with performance and best practices. Etsy has a rather low performance score and medium best practice score which got my attention. I noticed that a reoccurring suggestion was to remove unused css and java as well as to update front end JavaScript. Removing unused code and or updating code could help the overall performance score Etsy currently has. 

The second area of improvement can be seen in performance again. An issue that arose were how images were sized and maintained on Etsy. To solve this the best bet is to clean up  existing code so that images are properly managed and resized on the site.

The last area I saw room for improvement was in accessibility. Etsy has almost a perfect score in this category and the only issue I could see from the data was their text size. Adding an option to change text size would be beneficial in cases where the text is small. 

Overall, I found that auditing a website can be very easy especially using one of the three websites I talked about in the beginning of my post. Being able to see this information can help improve a site and create a better interface for a user which is the optimal goal for a website at the end of the day! 

Check out my Youtube video for a walk through: https://youtu.be/0IEs8ldST5U
How to add a program to the system path in a Chocolatey package
Tags: chocolatey, powershell, windows
Published: 2021-02-17 21:05:18

---
title: How to add a program to the system path in a Chocolatey package
published: true
date: 2021-02-16 05:00:00 UTC
tags: Chocolatey,Powershell,Windows
canonical_url: https://10xlearner.com/2021/02/16/how-to-add-a-program-to-the-system-path-in-a-chocolatey-package/
---

Hello ! I’m Xavier Jouvenot and in this small post, we are going to see how to add a program to the system path in a Chocolatey package.

_Self promotion_: You can find other articles on my [website](www.10xlearner.com) 😉

## Problematic

When creating a Chocolatey package, you may end up installing a program either in a totally different place than chocolatey packages binary folder, or [excluding the executables you want to install from getting shims](https://10xlearner.com/2021/02/12/how-to-exclude-an-executable-from-getting-shimming-in-a-chocolatey-package/). In such case, the program installed may not be directly accessible via the command line as it will not be present in one path included in the `PATH` variable of the system.

## Solution

To correct this problem, all you have to do is to include one of the two following lines:

```
Install-ChocolateyPath -PathToInstall "C:\actual\path\to\the\executable" -PathType User
# or, if the executable is getting shims are installed in the same place of the install script
Install-ChocolateyPath -PathToInstall $PSScriptRoot -PathType User
```

Pretty easy solution isn’t it ? You only need to know where your program is getting installed and everything will work fine 😉

* * *

Thank you all for reading this article, And until my next article, have a splendid day 😉

## Interesting links

- [PSScriptRoot documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.1#psscriptroot)
- [Install-ChocolateyPath documentation](https://docs.chocolatey.org/en-us/create/functions/install-chocolateypath)
- [Excluding an executable from getting shims](https://10xlearner.com/2021/02/12/how-to-exclude-an-executable-from-getting-shimming-in-a-chocolatey-package/)
- [10xlearner website](www.10xlearner.com)
ComparableGenerator, which automatically implements IComparable, has been released.
Tags: csharp, icomparable, sourcegenerator
Published: 2021-02-16 04:59:58

Implementing IComparable correctly is somewhat tedious. It is even more tedious to test each time.

ComparableGenerator provides a high quality implementation of IComparable.

NuGet : [ComparableGenerator](https://www.nuget.org/packages/ComparableGenerator/)

```cmd
Install-Package ComparableGenerator
```

## Introduction

For example, if you want to sort the Employee class by the Id property, declare the Comparable and CompareBy attributes.

```cs
using ComparableGenerator;

namespace GenerateSource
{
    [Comparable]
    public partial struct Employee
    {
        [CompareBy]
        public int Id { get; set; }
    }
}
```

The ComparableGenerator generates the following code.

```cs
using System;

namespace GenerateSource
{
    public partial struct Employee : IComparable, IComparable<Employee>
    {
#nullable disable
        public int CompareTo(object other)
#nullable enable
        {
            if (other is null) return 1;

            if (other is Employee concreteObject)
            {
                return CompareTo(concreteObject);
            }

            throw new ArgumentException("Object is not a GenerateSource.Employee.");
        }

        public int CompareTo(Employee other)
        {
            return Id.CompareTo(other.Id);
        }
    }
}
```

Of course, it also supports classes and multiple members.

```cs
[Comparable]
public partial class ClassObject
{
    [CompareBy]
    public int Value1 { get; set; }

    [CompareBy(Priority = 2)]
    public int Value2;

    [CompareBy(Priority = 1)]
    public int Value3 { get; set; }
}
```

When declaring CompareBy for multiple members, specify a unique priority for each.

[Here](https://github.com/nuitsjp/ComparableGenerator/blob/main/Source/Sample/ClassObject.Partial.cs) is the code generated in this case.


## Environments

- Supports C# 9.0 and higher

## Constraints

- Inner classes are not supported.
- Comparable and CompareBy contained in different "partial sources" are not supported.
Azure DP-900 Short Notes: Explore concepts of non-relational data
Tags: azure, cloud, dp900, certification
Published: 2021-02-16 04:09:39

👉Learn Module: [Explore concepts of non-relational data](https://docs.microsoft.com/en-us/learn/modules/explore-concepts-of-non-relational-data/)
<br>

## characteristics of non-relational data

👉Non relational data has no proper structure in them.

👉No scheme on Data.

👉Store the information for entities in collections or containers and not in relational tables.

👉Two entities in the same collection can have a different set of fields.

👉Data retrieval capabilities of a non-relational database vary based on stored data.

👉Advanced non-relational systems such as Azure Cosmos DB support indexing.

👉Use Cases include IoT and telematics, Retail and marketing, Gaming and Web and mobile applications.

---

## Describe types of non-relational data

👉Two types of non-relational data

1. Semi-structured Data
    - Data contains fields and two entities of same type can have different fields.
    - There are different formats of semi-structured data.
        1. JSON =Document enclosed in curly brackets.
        2. Avro =Row-based format.
        3. ORC = organizes data into columns rather than rows.
        4. Parquet = columnar data format.

2. Non-structured Data
    - Do not have fields.
    - Ex: Audio and Video

---

## Describe types of non-relational and NoSQL databases

👉Non-relational database also known as No-SQL database.

👉There are four types of non-relational database.

1.key-value store

- Each data item in a key-value store has two elements, a key and a value.
- Key uniquely identifies the item and valued hold the data.
- value is opaque(DBMS just sees the value as an unstructured block).
- Ex: Azure Table storage

2.Document database

- Each document has a unique and fields in the documents are transparent to the DBMS.
- Store data in JSON format or other formats such as XML, YAML, and BSON
- Ex: Azure Cosmos DB

3.Column family database

- Organizes data into rows and columns. Ex: ORC and Parquet files
- Conceptually similar to relational database but different in implementation.
- Ex: Apache Cassandra in Azure Cosmos DB supported through the Cassandra API

4.Graph database

- Store entities with a main focus on the relationship between these entities.
- stores two types of information. Nodes = Instances of entities and Edges= Relationships between nodes.
- Nodes and edges can both have properties that provide information about that node or edge.

---
Drools integration with Spring Boot
Tags: drools, springboot
Published: 2021-02-16 04:06:50

[Drools](https://drools.org/) is a versatile business rule engine that can elevate your application by externalizing a lot of decision  logic. As the most application servers are now using Spring boot, let's understand how to use Drools with Spring boot.

For a simple example, you can create a `KieContainer` as shown below.

~~~java
@Bean
public KieContainer getKieContainer() {
    KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
    kieFileSystem.write( ResourceFactory.newClassPathResource("discount.drl"));
    KieBuilder kb = kieServices.newKieBuilder(kieFileSystem);
    kb.buildAll();
    KieModule kieModule = kb.getKieModule();
    return kieServices.newKieContainer(kieModule.getReleaseId());
}
~~~

Once you have a container, You can execute the rules within it by creating a session and firing all rules.

More on this explained at [Drools integration with Spring Boot](https://springhow.com/spring-boot-drools/).
226. Invert Binary Tree

Tags: algorithms, javascript, trees, leetcode
Published: 2021-02-16 03:52:00

###Description:
Invert a binary tree.

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
// DFS approach
// In the recursion, you will traverse the tree until you hit to the bottom most leaf node
// The the right and left children of the current node will switch sides
// From the bottom going up, the ancestor nodes will switch their right and left child
// When we reach the root node, the tree will have been inverted
var invertTree = function(root) {
    // Stop when we reach a null value
    if(!root) return null;
    // Traverse the left side of the tree down to the leaf node
    const left = invertTree(root.left)
    // Traverse the right side of the tree down to the leaf node
    const right = invertTree(root.right)
    // Switch the placement of the children
    root.left = right
    root.right = left
    // Return the current node
    return root
};
```
How GIT Works
Tags: git
Published: 2021-02-16 03:41:17

In this post I will be covering how GIT works under the hood. So first lets take an example if you are making a project and you want to try some changes which is going to break the code and definitely you want to revert those changes so there are to ways to approach the problem one way is to just ctrl+z it but this solution is not good for many changed files and ctrl+z also has its limit. **A good solution** is to use GIT each GIT commit is a restore point and you can revert to that commit if you don't want to keep the changes but if you do want to keep the changes you made you can create a commit and GIT will keep all the changes you made and GIT will make you a restore point which can be used in the future.

## What is a GIT repository
A GIT repository is a hidden folder which contains all the commits or I like to call them restore points that can be used to revert to that commit.

## How GIT commit works
GIT commit has 3 stages they are :-
1. **Working directory** :- The directory in which you will make changes.
2. **Staging area** :- The directory in which you will select which files to keep and which files to discard.
3. **Repository** :- The place where the commit is saved.

So I am ending this post here bye and have a nice day!
Any queries ask me in the discussions
100DaysOfCode — Day 07
Tags: programming, docker
Published: 2021-02-16 03:40:30

Today, I finished the following sections in "Learn How To Code: Google's Go (golang) Programming Language" course:
 * Section 4: Variables, values, & type
 * Section 6: Go fundamentals
 * Section 8: Control flow


###### End of day 7 of 100DaysOfCode.
Website Auditing Tools
Published: 2021-02-16 03:35:48

**Lighthouse**
![Screenshot_1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6uqd7plxor6wdd47z1iq.png)
 
Lighthouse is an open-source, automated tool that was made to help improve the performance, quality, and correctness of your web apps. It is built into a google extension. It is very easy to download and use. To use Lighthouse you have to first search the website you want to audit and then go to your extensions to run the audit. Very simple and the ease is very convenient if you are very tech friendly but need to scan a site. When I run Lighthouse on YouTube it gives you many options on what you can do. There are four different report options, performance, accessibility, best practices and SEO. This gives you so many auditing options coming from a browser extension. What I noticed about the extension is that it is extremely easy to use and has a very simple layout. This layout is a little hard to look at in my eyes, but the content is all there. I am a big fan of this audit tool.

**Web.dev**

Web.dev is not like lighthouse, as it is not a browser extension but its own external extension. It is set up with the same audit report options, performance, accessibility, best practices and SEO. To use this you just copy the URL and paste it into the site, this gives the user the report. All you need to really understand this is a basic understanding of HTML, CSS, and Java, but really isn’t necessary.

**WAVE**

 WAVE is also a web accessibility evaluation tool that gives creators the option to make their web content more accessible to individuals with disabilities. When first using this I noticed how it is set up very different then Lighthouse and Web.dev. This auditing tool gives a great detailed assessment on the website that is queried. I noticed that this tool is a little hard to look at a bit overwhelming when first using. It does give you a different auditing report than Lighthouse and Web.dev. It gives a summary, details, reference, structure, and contrast. So it has great options to be able to understand what can be on our site to cater to people who have visual disabilities.

Here is my video explaining ----- https://www.youtube.com/watch?v=HhQ8QgmCLfk
ตรวจสอบค่า slot ด้วย $$slots ใน Svelte3
Tags: svelte3, webcomponents, slot, htmlelement
Published: 2021-02-16 03:19:40

เมื่ออ่านมาถึงบทนี้ ก็คงจะพอรู้และการใช้งาน slot มาพอสมควรแล้วคราวนี้เรามาลองตรวจค่าจาก slot กันหน่อย

สืบเนื่องจาก slot มีการกหนด fallback ได้ ปัญหาในเรื่องนี้คือ เมื่อเราไม่กไหนดค่าให้ slot default แต่ slot ก็ยังค่า fallback content อยู่ดี ถ้่าหากเราต้องการตรวจสอบค่าจาก slot นั้นก่อนจะทำอย่างไร มาดูกันครับ

```javascript
/* Comment.svelte */
<div class="discussion">
  <h3>Comments</h3>
  <slot name="comment">
    default slot
  </slot>
</div>

/* App.svelte */
<script>
  import Comment from "Comment.svelte";
</script>

<Comment>
  <span slot="comment">Title Comment</span>
</Comment>

<Comment />

```

ผลลัพธ์
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hwb8s8bsjtme55v1fduf.png)

แต่ถ้าเราอยาก check ค่า slot ก่อนว่ามีการส่งค่า named slot มาไหมแล้วค่อยแสดง content ได้ เราสามารถใช้ `$$slots` ตรวจสอบค่าได้

```javascript
/* Comment.svelte */

{#if $$slots.comment}
<div class="discussion">
  <h3>Comments</h3>
  <slot name="comment">
    default slot
  </slot>
</div>
{/if}

```

ผลลัพธ์
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ryku7smlitbofbusgu9k.png)

ถ้าเราไม่ได้ส่ง named slot เข้าไปมันก็ไม่แสดง fallback content ออกมาแล้ว
ลองไปปรับใช้กันนะครับ

ศึกษาเพิ่มเติมเรื่อง slot tag ได้ที่ [slot tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot)

หากสนใจ svelte สามารถเรียนรู้การใช้งาน svelte แบบ step by step ได้ที่
[Svelte: Framework Not Framework — (ตอนที่ 1) แรกรู้จัก](https://medium.com/@tanangular/svelte-framework-not-framework-%E0%B8%95%E0%B8%AD%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88-1-%E0%B9%81%E0%B8%A3%E0%B8%81%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%88%E0%B8%B1%E0%B8%81-434fde7ff97f)

ขอบคุณทุกท่านที่อ่านมาถึงตรงนี้ ถ้าอ่านแล้วรู้มีประโยชน์ ฝากกด Subscribe หรือ share link ให้คนอื่นรับรู้ด้วยนะครับ ขอบคุณครับ
My Very First Flatiron Project!
Published: 2021-02-16 02:59:48

OVERVIEW

For my first project at Flatiron, I was given the task of building a Ruby CLI Application, by either scrapping or utilizing an API from a public website. 

Initially I struggled with ideas for the project. I went through many different ideas and APIs before deciding to build an app that would utilize data on the newly developing islands in the Caribbean. 

DEVELOPMENT

My application uses the Rest Countries Caricom regional bloc Api, which allows any user to list a few of the countries along with its data. 

First thing I needed to do was build a API class, which gathered all the information from my Apis endpoint. Secondly, a Country class which initializes object instances for the countries. And last, but not least, a Cli class which interacts with the user/users. 

CONCLUSION

I learned alot during this entire process, including being able to create a new repository, adding, committing and pushing my work through github in order to save it. 

My hardest struggle was not being able to properly execute my ideas in the Cli class, but after weeks of ferociously coding and with the help of my tutor Brandon, I can proudly say I am very happy to be able to immerse myself in greater depths of understanding Ruby!
Build a Command-Line Pomodoro Timer in Node.js
Tags: node, javascript, productivity
Published: 2021-02-16 02:41:01

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vpzrogmp5sbcy7shnpgl.png)

Here is the source code - https://github.com/Open-EdTech/node-pomodoro
## Motivations

When I started learning about task execution systems like Pomodoro, I thought putting together a CLI myself would be a great way to create a sense of ownership and pride in my work. Also, it would let me ship the features I needed.

## Requirements
* Tracks progress towards completing a given number of hours of work
* Sets goals for continuous work block and break lengths
* Looks nice so productivity streamers can use it
* Emits logs for analysis at a future date

## Design
### Classes vs. Functional
Originally I just made a countdown timer and built off of that. I usually don't write classes, but having a mutable internal state was a really easy way of thinking about the problem.
### Start Small, Build Up
I'm not very experienced with node.js, so I started by displaying a simple countdown to get my feet wet. The general idea is to use setInterval to set a 1000 millisecond delay between each second on the clock. Originally I used `process.stdout.write` but once I found a library for displaying progress bars I realized that the progress bars would be a great way of displaying information about your study goals.
### Using npm libraries

I used [enquirer](https://www.npmjs.com/package/enquirer) to take the user input. 
Here's what it looks like -
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c30xmvw0air7po5wo8wo.png)

The display is simply the multi-progress bar from the [CLI-progress](https://www.npmjs.com/package/cli-progress) library. This is way better than writing to the console yourself. Here's the block I'm on right now - 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wg5yivbljtzqalp4npq.png)

## Write to a file

The code writes to a file in the `sessions` folder of the project. The filename is the ending time of the session. The contents look like this - 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3dgnjpbhpo624ir69q57.png)

This way I can perform an analysis at a later date to track the time I spend contributing to open-source.

## Thanks for reading!
If you give it a try be sure to read the readme. https://github.com/Open-EdTech/node-pomodoro
Does anyone know if you can tell whether a user is logged in/out with google OAuth?
Tags: googlecloud, python
Published: 2021-02-16 02:14:05

Hi All!
First "POST" here haha.

I was wondering if any of you dev peeps know how to check if a user is logged in or not to your website's google OAuth. I have been spending a whole day on it and can't figure something out :(((
My SO(https://stackoverflow.com/questions/66213239/how-to-check-in-if-user-is-logged-in-from-google-oauth2-web-server-not-client)
Azure Security Audit Tool - SkyArk
Tags: azure, securityaudit, opensource
Published: 2021-02-16 02:12:34

---
title: Azure Security Audit Tool - SkyArk
published: True
description: Cloud Audit Tool
tags: Azure , SecurityAudit, OpenSource
//cover_image: https://direct_url_to_image.jpg
---
SkyArk is a security audit tool for Azure and AWS . This tool can help researchers discover, evaluate and protect privileged entities in Azure and AWS. Essentially, SkyArk is a cloud security project. 
The tool contains two main scanning modules:
1. AzureStealth - Scans Azure environments
2. AWStealth - Scan AWS environments

These two scanning modules can help us discover privileged entities in the target AWS and Azure.

SkyArk currently focuses on mitigating security threats to the cloud environment and helping organizations discover, evaluate and protect the security of cloud privileged entities. The secret cloud management credentials may be stored in various places on the public cloud platform, and SkyArk can help administrators reduce the security risks faced by AWS and Azure.

In the process of security defense, penetration testing, and risk assessment, we need to ensure that security risks are resolved, and to verify whether the privileged entity is sufficiently secure, SkyArk came into being.

# Details
SkyArk can use the scan results to help organizations find the entities with the most sensitive and dangerous permissions in their resources, including users, groups, and roles.

In addition, we also encourage major organizations to scan their environment regularly and ensure that the scan results will not be too biased. For attackers, they will look for these user roles, and defenders will ensure the safety of these privileged users. It’s important that we cannot protect what we can’t see and don’t know, but SkyArk can help us complete these complex tasks.

### AzureStealth Scan
Discover the most privileged users in the scanned Azure environment - including the Azure Shadow Admins.
  
**How To Run AzureStealth**  

The full details are in the AzureStealth's Readme file:  
[https://github.com/cyberark/SkyArk/blob/master/AzureStealth/README.md](https://github.com/cyberark/SkyArk/blob/master/AzureStealth/README.md)  
In short:
1.  Download/sync locally the SkyArk project
2.  Open PowerShell in the SkyArk folder with the permission to run scripts:  
    "powershell -ExecutionPolicy Bypass -NoProfile"
3.  Run the following commands:
```
(1) Import-Module .\SkyArk.ps1 -force
(2) Start-AzureStealth
```
 AzureStealth needs only Read-Only permissions over the scanned Azure Directory (Tenant) and Subscription.  
 *You can also run the scan easily from within the Azure Portal by using the built-in CloudShell:  
 ```
    (1) IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/cyberark/SkyArk/master/AzureStealth/AzureStealth.ps1')  
    (2) Scan-AzureAdmins  
```  
 **AzureStealth DEMO:**  
![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg25qf9qlo1irc4feour.gif)