A step by step guide for beginners to get started with Puppeteer

The whole point of the puppeteer is lost if you keep doing things manually!

What’s Puppeteer?

With Puppeteer, automate routine jobs that you occasionally do in the web browsers. In Puppeteer, you can control everything in the browser, from simple navigation to use Lighthouse for auditing your website.

Before starting everything, take a look at the following example of a Puppeteer script:


A step by step guide with a full working example of decimal data type in .NET gRPC

Image by Gerd Altmann from Pixabay

If you check the Protocol Buffers (protobuf) language guide, you’ll see it only supports float and double for real numbers. In most cases, they are good to go. But if part of your data includes currency values, they are not the ideal choices because they are not precise.

> 3.99d * 5
19.950000000000003

We expected 19.95 but after calculation it’s 19.950000000000003 and that’s why they are not good for currency values.


GitHub Actions are great, and you can easily automate your workflows (from simple CI/CD to more complex workflows) with them. I use GitHub Actions for my Project AzureAutoNumber as my CI/CD pipeline. During the last update, I encountered a problem that I couldn’t run my tests (xUnit based).

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101

To have .NET 5 SDK in my build process, I changed dotnet-version to 5.1.101.

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.1.101

The build process went fine, but during the test phase…


With .NET, it’s always easy to generate self-signed certificates for your web applications. You can issue them in Visual Studio or dotnet SDK command-line. If you create a new web application in Visual Studio, at first, you’ll see the following message:

Or you can quickly issue your self-signed certificate for localhost with the command below:

dotnet dev-certs https# the possible result after succesful execution would b:
# The HTTPS developer certificate was generated successfully.

But sometimes, like my case, it won’t help, and you’ll see this annoying exception:


Nobody likes advertisements and Web trackers, and I’m not an exception. I started using Brave Browser, or I used a different kind of browser plugins to To get rid of those.

Although browser adds blockers block trackers/ads they are not perfect; for example, they are only useful inside the browser not in applications or games or devices like TVs. There is a simple open-source yet powerful solution for this problem: Pi-Hole.

Pi-Hole is a network-wide Ad Blocking software functions similarly to a network firewall. …


The Windows Subsystem for Linux (WSL) is an ultimate feature from Microsoft that enables developers to run a GNU/Linux environment directly on Windows, unmodified, without the overhead of a traditional virtual machine or the dual-boot setup.

In WSL2, they made lots of performance improvement alongside adding new features such as Managed VM, Full Linux Kernel and Full system call compatibility.

If you enable and install WSL-2 on your Windows, in Docker-desktop can use WSL-2 based engine for better performance.


One of the main difference from .NET Framework and .NET Core is that .NET Core supports self-contained deployment; everything is bundled together, including runtime and app. That brings easy deployment, but there is draw-back: Increasing application size because the runtime is included too.

Imagine you have a small desktop or web application, but the deployment size is like 200MB, that doesn’t sound good, right?

In .NET Core 3, to resolve this issue, the .NET team introduced a tool that finds unused assemblies to remove them from final deployment. In .NET 5 they went one step forward; not only can it…


More than a year ago, I answered a question on StackOverflow about choosing between Node or Dart-Sass for Vue CLI. It got lots of up-votes, and I thought maybe it is worth diving deeper into this topic.

Introduction

This article is mainly about Sass, and it’s preprocessor implementations: Dart-sass and Node-Sass.

So, what’s a CSS preprocessor?


Sample query tagging!

What is query tags in EF Core?

var publishedBlogPosts = dbContext.BlogPosts
.Where(b => b.PublishedAt != null)
.TagWith("Getting published blog posts")
.ToList();

When EF generates the SQL with TagWith method, it also includes the tag as a comment in the query; as a result, debugging and profiling queries might be easier.

-- Getting published blog postsSELECT [b].[BlogPostId], [b].[Content], [b].[PublishedAt], [b].[Title]
FROM [BlogPosts] AS [b]
WHERE [b].[PublishedAt] IS NOT NULL

How to make it more practical?


Use perl module to read environment variables

If you google for Nginx docker and environment variables you’ll end up with the envsubst workaround to pass environment variables to the docker container. Although that workaround works, it’s not that flexible and easy to operate.

The docker image:

I like alpine-based images because they are light-weight and secure. You might wonder why I’m using Perl enabled image, the answer is short: To be able to read environment variables in Nginx, the nginx-mod-http-perl module is needed and that runs on Perl!

FROM nginx:1.18.0-alpine-perlRUN apk add --no-cache nginx-mod-http-perlCOPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80/tcp
EXPOSE 443/tcp
CMD ["/bin/sh", "-c", "exec nginx…

Ali Bahraminezhad

I’m a geek, a software engineer who likes to build amazing stuff 😉Here on Medium I write about different things but mostly focused on programming and .NET!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store