teleren/devto huggingface dataset:
Google Chrome might show you a badge for slow websites
Tags: google, performancetesting, googlechrome
Published: 2019-11-14 19:43:16

---
title: Google Chrome might show you a badge for slow websites
published: true
date: 2019-11-13 19:49:44 UTC
tags: Google,Performance Testing,Google Chrome
canonical_url: 
---

Google Chrome is experimenting a feature which identifies whether the website is loading faster or slower. Based on various factors, Chrome will be able to display the badge if the website load time is high; if not, it just displays the green line bar at the top.

This badging process will certainly help us to know the quality of the website. From the Google Chrome blog, the team mentioned that

*Badging is intended to identify when sites are authored in a way that makes them slow generally, looking at historical load latencies. Further along, we may expand this to include identifying when a page is likely to be slow for a user based on their device and network conditions.*

Clearly, you can see that speed is just one of the factors. On the long run, Google Chrome will weigh additional parameters for badging the site.

*Our plan to identify sites that are fast or slow will take place in gradual steps, based on increasingly stringent criteria. Our long-term goal is to define badging for high-quality experiences, which may include signals beyond just speed.*

[Google Chrome might show you a badge for slow websites](https://qainsights.com/google-chrome-might-show-you-a-badge-for-slow-websites/) appeared first on [QAInsights](https://qainsights.com).
Powershell script that downloads .gitignore template by name
Tags: git, github, powershell
Published: 2019-11-13 19:49:09

---
title: Powershell script that downloads .gitignore template by name 
published: true
description: Small tutorial how to use a git-ignore PowerShell script to download .gitignore template from Gitignore project on Github. 
tags: git,GitHub,PowerShell
---

There is a Github project, if you didn't know about it already, that contains common .gitignore template files for different platforms, IDE-s, Frameworks, Languages, etc.

To get the file by yourself you can:
- Clone project than copy files that you need
- Copy contents of the file and create it locally
- Or use a PowerShell script to download it into the active folder

Download script from repository https://github.com/senad-meskin/powerscripts or you can copy the contents of the file directly from https://raw.githubusercontent.com/senad-meskin/powerscripts/master/git-ignore.ps1 and save it locally inside the folder that is added to your Environment PATH.

To download a template from the repository https://github.com/github/gitignore just call the script and pass template name as the first parameter (Case sensitive)
```
git-ignore VisualStudio
```

where `VisualStudio` is a template name without `.gitignore` extension from Gitignore repository

![List of .gitignore templates](https://thepracticaldev.s3.amazonaws.com/i/8sx3ug1t1gslxj9akfcz.jpg)
Let's build Flawk.to - Week 5
Tags: discuss, showdev, react
Published: 2019-11-13 19:38:31

### Cover Photo by Christina @ wocintechchat.com on Unsplash

I have been building [flawk.to](https://flawk.to) for the past couple of weeks. It has been a fun journey, and I have been enjoying  live streaming it every week! Last week I was sick and could not stream, but I had lots of time to think about what to do next. I considered picking up were I left off and jumping straight into the missed stream content. After having some conversations I have changed my mind.

I have been focusing a lot on trying to tailor the content to people. Rather than working on things that will get Flawk.to done. Don't get me wrong, I have been enjoying it and it definitely crossed my mind to continue. Although, my goal is to deliver value with Flawk.to and to do that it needs to be a working product.

This week I will be coding some screens and doing some flows through the app! At the root of Flawk.to is event hosting and attending. So I am going to attempt to code out as much of those flows as I can tonight. There will be a lot of styled-components and React with some framer motion tonight. Without bells and whistles it is not a large application. So let's dive in tonight at [9PM EST](https://in-my-tz.now.sh/t/32312c416d65726963612f546f726f6e746f) and get something done!

---

We have a [public roadmap](https://flawk.to/roadmap)! You can vote for features you want to see!
The escape key; just a vim need?
Tags: discuss, watercooler
Published: 2019-11-13 19:33:21

Lately I've been thinking about how I rarely use the <kbd>esc</kbd> key and now the new Mac has brought back physical escape keys due to previous criticisms...And I'm wondering...who besides vim users needs that escape key so frequently?

So please tell me, what are you using that escape key for?
Are you doing anything with "edge compute"?
Tags: discuss, webperf
Published: 2019-11-13 19:06:29

I put "edge compute" in quotations because I think it's a flexible definition, but it's a fascinating area of software development.

We've been early in this game with DEV in a way, since we use logic at the edge via Fastly to make certain choices about content, and often don't have to go all the way to the origin. But since we established our process, the options within this field are becoming more and more interesting.

[Cloudflare workers](https://www.cloudflare.com/products/cloudflare-workers/) and the recently announced [Compute@Edge](https://www.fastly.com/blog/join-the-beta-new-serverless-compute-environment-at-the-edge) by Fastly represent pretty darn cool options. [Lambda@Edge](https://aws.amazon.com/lambda/edge/) is another interesting one.

This really is one of the coolest trends IMO. It's hard to argue with the benefits of cutting down latency and running performant code nearer to the end user.
Extracting content from Unity packages in terminal
Tags: unity3d, gamedev, bash, linux
Published: 2019-11-13 18:52:29

While I was researching some physics mathsy stuff, the only actual source code implementation I could find was buried inside a Unity asset thing. I don't use Unity, but as far as I know you can only download Unity packages through the Unity editor, not through the Unity asset store website, and it still won't seem to let you browse through the asset's source.

Regardless, here's a method to extract Unity `unitypackage` files properly and not just the GUID names with hexadecimal directories.

For example the Standard Assets package:
```bash
$ file Standard\ Assets.unitypackage
Standard Assets.unitypackage: gzip compressed data, extra field,
last modified: Mon Mar  5 16:28:50 2018, max compression,
from Unix, original size 250911232
```

Not only is the file gzipped, but underneath it's also a tar archive, so we can extract everything like so:
```bash
$ tar zxfv Standard\ Assets.unitypackage --one-top-level=Standard\ Assets
```

All the package content has now been extracted into the `Standard Assets` directory, but it's not very usable as there are tons of directories with meaningless hexchar GUID names; but they all contain a `pathname` file that we can process and use to organise the data with this simple oneliner:
```bash
$ find -name asset -exec bash -c '\
	filename="`dirname "$(dirname "{}")"`/`cat "$(dirname "{}")/pathname" \
		| cut -d$'"'\n'"' -f1 \
		| tr -d "\n"`"; \
	filedir=`dirname "$filename"`; \
	mkdir -p "$filedir"; \
	echo "Extracting \"$filename\"..."; \
	cp "{}" "$filename"' \;
```

Having done that the intermediate directories can be cleaned up:
```bash
$ find -type d -regextype sed -regex '.*[0-9a-f]\{32\}' | xargs -I{} rm -rf "{}"
```

All the files should now be extracted properly and you can poke around with them! Hooray!
```bash
$ ls Standard\ Assets/Assets/Standard\ Assets/
2D  Cameras  Characters  CrossPlatformInput  Editor  Effects  Environment
Fonts  ParticleSystems  PhysicsMaterials  Prototyping  Utility  Vehicles
```

You can untar multiple unitypackages before running the oneliner and it will extract all of them at once!
Boost Your Productivity As A Coder By 73.3098% With This One Simple Trick
Tags: productivity
Published: 2019-11-13 18:47:04



So, it's 7:30pm and I'm calling it a day. Since you don't know me, last time I stopped working this early the US President wasn't blonde. Just to give you an idea.

I'm starting to appreciate that the mind sometimes needs time and space, and I don't have to always be productive (in the sense of typing code) from minute one of a new feature build. For example I have to build a new chart by Friday and this afternoon I studied pros and cons of two different solutions. I've almost decided which one to use but I feel like I need my subconscious to process this new information for an evening and a night.

It will never cease to amaze me what the brain is capable of doing while we are _not_ thinking about the problem!
Moving Forward.cpp
Tags: vi, discuss, cpp
Published: 2019-11-13 18:26:47

---
title: Moving Forward.cpp
published: True
description: A short post on what's next
tags: C++, vi, discuss
---

This is gonna be a relatively short and sweet article. I recently began refreshing myself on C++ (post C++98) and that gave me an idea to possibly look into game development. Although I'm very aware it's frowned upon to code your own game engine, that's exactly what I will be doing. So to basically sum things up without being too winded, I'll be using this to post Hack the Box (HTB) write-ups of boxes that I pwn once they retire, and I've also thought of the possibility of detailing my game dev projects here. Anyway, stay tuned for more folks!

P.S. Below is a simple calculator program I wrote, it's available on my github page as well in the 'Calculator' repo. Feel free to improve it, break it or whatever you feel like doing. If you make it do something cool or unexpected definitely let me know. If you want to add algebraic functions or something similar that's also fine.

calc.cpp:

```
/* This is my first attempt at a calculator program. It will have the ability to add, divide, subtract, and multiply values given to it by the user */

#include <iostream>
#include <unistd.h>

int getValueFromUser()
{
	std::cout << "Enter an Integer please: ";
	int input{ 0 };
	std::cin >> input;
	std::cout << "[+] Storing value, please wait\n";
	sleep(2);
	return input;
}

int add(int x, int y)
{
	return x + y;
}

int multiply(int z, int w)
{
	return z * w;
}

int sub(int b, int c)
{
	return b - c;
}

int divide(int d, int e)
{
	return d / e;
}

void doCalc(int choice)
{
	int a{ };
	int s{ };
	int m{ };
	int di{ };

	switch(choice) {

		case 1 :
			a = ( add( getValueFromUser(), getValueFromUser() ));
			std::cout << "Your Total for addition is => " << a << "\n";
			std::cout << "\nThank you for using the Calculator\n";
			break;
		case 2 :
			s = sub( getValueFromUser(), getValueFromUser() );
			std::cout << "Your Total for subtraction is => " << s << "\n";
			std::cout << "\nThank you for using the Calculator\n";
			break;
		case 3 :
			m = multiply( getValueFromUser(), getValueFromUser() );
			std::cout << "Your Total for Multiplication is => " << m << "\n";
			std::cout << "\nThank you for using the Calculator\n";
			break;
		case 4 :
			di = divide( getValueFromUser(), getValueFromUser() );
			std::cout << "Your Total for Division is => " << di << "\n";
			std::cout << "\nThank you for using the Calculator\n";
			break;
		case 5 :
			std::cout << "Thanks for wasting your own time fam. You played yourself\n";
			exit (EXIT_SUCCESS);
			break;
		default :
			std::cout << "The Instructions were clear than a mothafucker dog, learn to read.\n";
			std::cout << "You know what fuck this shit I'm aborting\n";
			exit (EXIT_SUCCESS);
	}
}

int main()
{
	int choice{ 0 };
	std::cout << "Welcome to Tepi's original Calculator written in C++\n";
	std::cout << "Would you like do (1) Addition, (2) Subtraction, (3) Multiplication, (4) Division, or (5) Exit?\n>";
	std::cin >> choice;
	doCalc(choice);
	return 0;
}


```
Real Amazon ECR Repository Pull Policy 
Tags: note, devops, aws, ecr
Published: 2019-11-13 18:46:16

Unfortunately  [AWS documentation](https://docs.aws.amazon.com/en_us/AmazonECR/latest/userguide/RepositoryPolicyExamples.html) doesn't give us full permission settings to pull images from ECR. And if you'll use only 
```json
{
  "Version": "2008-10-17",
  "Statement": [
    {
      "Sid": "AllowPull",
      "Effect": "Allow",
      "Principal": "*",
      "Action": [
        "ecr:GetDownloadUrlForLayer",
        "ecr:BatchGetImage",
        "ecr:BatchCheckLayerAvailability"
      ]
    }
  ]
}
```
... you'll get 
`
iam-role/long-strange-number is not authorized to perform: ecr:GetAuthorizationToken on resource: * status code: 400
`

And what you really need is to set up ecr:GetAuthorizationToken rights to * resource. So full policy will be:
```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": [
                "ecr:GetDownloadUrlForLayer",
                "ecr:BatchGetImage",
                "ecr:BatchCheckLayerAvailability"
            ],
            "Resource": "arn:aws:ecr:eu-central-1:*:repository/*"
        },
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": "ecr:GetAuthorizationToken",
            "Resource": "*"
        }
    ]
}
```
I did it! I attended my first Dev Conference and I didn't die.
Tags: webdev, developer, newbie, chromedevsummit
Published: 2019-11-13 18:44:12

---
title: I did it! I attended my first Dev Conference and I didn't die.
published: true
description: My first Dev Conference experience
tags: webdev, developer, newbie, chromedevsummit
---

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jroamzzhjcaixvw1c67m.png)

I attended my first software developer conference(s) last week: Blavity's AfroTech and Google's Chrome Dev Summit.

In theory, two back-to-back 2-day conferences seemed like a good idea. In reality, it was an exhausting awesome experience: l met so many people & got great tips.

I won't go into details about what I learned, I'll just describe it with four hashtags: **#insightful, #pivotal, #motivational and #worthIt**

PS. Shout out to @tvanblargan for sharing this post (it really helped) - "The Introvert's Guide to Tech Conferences" https://dev.to/geekgalgroks/the-introverts-guide-to-tech-conferences-22nf

Cheers!
ICYMI - GitHub Sponsors - Phalcon
Tags: github, phalcon4, sponsors, funding
Published: 2019-11-13 19:10:22

---
title: ICYMI - GitHub Sponsors - Phalcon
published: true
date: 2019-11-13 18:41:02 UTC
tags: github,phalcon4,sponsors,funding
canonical_url: 
---

Today we watched live GitHub Universe, GitHub’s main product conference of the year. GitHub Sponsors for Teams was announced and Phalcon is on it!

The event took place today around 9:00 PST. Devon Zuegel demonstrated the new GitHub Sponsors for Teams!

[Wach Live Stream](https://youtu.be/9EoNqyxtSRM?t=4098)

Phalcon has been working with GitHub and entered the alpha version of this product. We are happy to announce that we have been accepted and **now have a sponsor page on GitHub Sponsors**!

You can click the **Sponsor** button at the top of any of our repositories, or simply visit the [https://phalcon.io/fund](https://phalcon.io/fund) link to visit our sponsors page!

If you have already decided to sponsor us via [Open Collective](https://opencollective.com/phalcon), the link will still be there. If you want to switch over to [GitHub Sponsors](https://phalcon.io/fund), by all means you can do so!

Our [GitHub Sponsors](https://phalcon.io/fund) additionally has our vision with regards to funding and how we intend on spending those funds to better the framework.

PS: Sadly our logo was not featured in the presentation, oh well :)

![](https://assets.phalcon.io/phalcon/images/emoji/heart.png) Phalcon Team
New logo for Edge Chromium, highlights from Microsoft Ignite and the Svelte Handbook | Front End News #25
Tags: news, frontendnews
Published: 2019-11-13 18:39:45

Hello everyone and welcome to another round of Front-End News. I hope you will enjoy the subjects I've selected for you in this edition.

- Microsoft unveils the new Edge logo
- Highlights from the Microsoft Ignite event
- The Svelte Handbook
- Software updates and releases

***

## Microsoft unveils the new Edge logo

![The new Edge logo](https://thepracticaldev.s3.amazonaws.com/i/7fm8t47obpmejm2qxqsv.jpg)

Microsoft released an updated identity for the upcoming Chromium version of its Edge browser. The entire process was the online equivalent of a treasure hunt where hundreds of people worked on a series of puzzles and a game inside the new browser.

- https://www.microsoftedgeinsider.com/en-us/
- https://blogs.windows.com/windowsexperience/2019/11/04/introducing-the-new-microsoft-edge-and-bing/
- https://twitter.com/MicrosoftEdge/status/1191377092807708672

***

## Highlights from the Microsoft Ignite event

![Microsoft Ignite](https://thepracticaldev.s3.amazonaws.com/i/d21fe6f5jx4eon69wrqp.jpg)

Microsoft organized its 2019 version of the Ignite conference where we found out a lot about the company plans for the near future. The team maintaining the @MSEdgeDev Twitter channel was kind enough to put together highlights for the two days of the event. This way you can the latest updates even if you missed the live session.

- https://twitter.com/i/moments/1191417118941540353
- https://twitter.com/i/moments/1192106156908400646
- https://www.microsoft.com/en-us/ignite

***

## The Svelte Handbook

![The Svelte Handbook](https://thepracticaldev.s3.amazonaws.com/i/emjmfx2gq380lg9ohym3.png)

freeCodeCamp and Flavio Copes strike again with yet another handbook. This time it's one for Svelte, one of the up-and-coming frameworks that come to challenge the Angular-React-Vue trio. The book is meant for developers who know nothing about the framework but are looking for an alternative to the current industry landscape.

- https://www.freecodecamp.org/news/the-svelte-handbook/

***

## Software updates and releases

Here are the updates and releases for this edition. In each case, you can find the full details in the release notes linked down below.

### Visual Studio Code October 2019 (v1.40)

- https://code.visualstudio.com/updates/v1_40

### TypeScript v3.7

- https://devblogs.microsoft.com/typescript/announcing-typescript-3-7/

### Node v13.1.0

- https://nodejs.org/en/blog/release/v13.1.0/

### Chalk 3.0

- https://ghost.org/blog/3-0/

***

That’s all there is in this edition. Follow Front End Nexus on Twitter at https://twitter.com/frontendnexus to be notified as soon as a new update happens. I also want to encourage you to subscribe to the YouTube channel at https://www.youtube.com/channel/UCgACtqiDmnSaskDIBsK54ww. I can unlock some more options once the channel hits 100 subscribers, so your support is highly appreciated.

Have a great and productive week and I will see you next time!
Swastik Pattern in C++
Tags: cpp, pattern, logic
Published: 2019-11-13 18:24:42

Hello World!!
So, Today we are going to talk about patterns in c++. Some people have a question why Patterns?? My answer to it is "Improves your Logic" and if you're going to sit in a Campus Interview I would suggest you, go through patterns, improve your logic because many times there are questions about patterns and logic.

So let's, Start today we will learn a pattern called Swastik.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ik5i3isuhhgmpr01lhqp.PNG)

I would suggest you try it out the pattern first if you get stuck go through the code and if you are a newbie follow along.

First, we declare variables and ask the user for the number of row/columns(i.e 'n') and then we calculate mid-value.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/1r2hlzuhkktdwh613nep.PNG)

Now, assume that we have entire n * n Matrix as shown below. We divide it into 4 parts.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xwecg562d2bs2nm95xk3.PNG)

We will use 2 for loops: 
(a)For rows of 1 to mid-value(first 3 rows in the above image ).
(b)For rows of mid-value to n(next 2 rows in the above image).

Each for loop contains 2 for loops:
(c)For a column of 1 to mid-value(left side).
(d)For a column of mid-value to n(right side).

We enter the first main loop. In this loop, we loop through the 1st part out of 4 parts.
now if j==0 or j==mid or i==mid we print "*".

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jxnjrur2hzk1qracjljb.PNG)

Now, loop through the 2nd part out of 4 parts. If i==0 or i==mid we will print "*".

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/wlc6ugddjhhp804as0ko.PNG)

We enter the Second main loop. In this loop, we loop through the 3rd part out of 4 parts. IF j==mid or i==n-1 we will print "*".

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/z6uz38yc92jjs1dr2y5r.PNG)

Now loop through the last part. If j==n-1 we print "*".

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/766ru4b78lqu15prs2lk.PNG)

So, that's it. You can go through entire code at https://github.com/Naivedh/Swastik

Note: The spacing provided before-after "*" is so that it looks good you can remove it.

If you want to practice more patterns. Here are some of them.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4rd7j3trnto0tx94olou.png)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/76y4hrnrq5cdtnarjl6s.jpg)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/kiiqkm3sez69cxf23tni.jpg)
dotfiles: Hone your software tools
Tags: productivity, dotfiles
Published: 2019-11-13 18:03:41

My dad taught me that if I took care of my tools, they would serve me well and last a lifetime.  **Software tools are no different.** If you give them attention, they will serve you well.

Our primary tools as software craftspeople are text editors, shells, and version control systems.  These tools are refined via *dotfiles*.  dotfiles are those files and directories on your computer that often begin with a `.` and hold configuration settings for softare.  `.bashrc` is a well known dotfile that stores settings for `bash` like a custom `PATH` or short aliases for frequently used commands.

Careful attention to your dotfiles unleashes the full power of your tools.  With my dotfiles and two keystrokes, I can run a full test suite or a single unit test or search my entire project in a split second.  By studying these configuration files, you learn all the options that are available to you.

*How do I start taking advantage of these files?*, you might ask.  Look at how others do it.  [http://dotfiles.github.io/](http://dotfiles.github.io/) is a great resource to start.  This site contains plenty of example user repositories and a collection of tools to control dotfiles to get you going.  If you use Vim, Zsh, or Git, you can take a peek at what I've done to [my dotfiles](https://github.com/mblayman/dotfiles) (you may also learn something even if you **don't** use those tools).

Don't chop down your next software project with a dull axe.  *Hone your software tools.*

This article first appeared on [mattlayman.com](https://www.mattlayman.com/blog/2015/dotfiles/).