teleren/devto huggingface dataset:
Deploying a Site with Vercel
Tags: vercel
Published: 2022-03-14 02:05:43

## What is Vercel?

- Vercel is a platform that allows you to easily build, deploy, and scale a website and have it viewable to the world in literal seconds.

- If you ever had trouble getting a site to build using GitHub Pages, Vercel takes away all the extra work and configures everything for you.

- I've never had an easier time when it comes to deploying a website than when I used Vercel.


## How to get started with Vercel

- To get started with Vercel you are going to want to go to their [website](https://vercel.com/cli). The homepage will look like this:

![Vercel Website Homepage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbxv05lql75sfb2h7fzc.png)

- Once here you can install Vercel either to a specific project or globally using the command below. Use the command either in a specific project directory or just as you launch terminal. 

`npm i -g vercel` 

- You next step will be to login to Vercel and provide access to your GitHub account. Once your GitHub account has access you can go to your dashboard and create a project.

- Once you click the create a project button you can choose a GitHub repository you will like to deploy and then it's as simple as pressing the deploy button. As long as the code is all in the correct directories and npm start is working then the website should deploy with no issues.

## 11ty Blog Site Deployed with Vercel

- Here is an example of a blog site I created with an 11ty template. I was able to deploy the website through Vercel and have this live version for anyone to go to and look at the website.

![11ty Blog Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wzo3oflgkosfw295y81n.png)

To access the website you can click [here.](https://11ty-lab-website-1.vercel.app/)

## ist-vercel-demo Deployed with Vercel

- Here is the ist-vercel-demo we had to clone for class and then get working as a website with Vercel.

![ist-vercel-demo Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzfoupwdyo4w722l5avo.png)

The link to the site is [here.](https://vercel-demo-flax.vercel.app/)

- Getting this website to deploy was as simple as clicking the button and waiting for Vercel to do its job. Seriously made creating a website one of the simplest processes ever.

## How does Vercel compare to other ways of deploying as a developer

- Compared to using GitHub pages and manually setting up work flows can be frustrating to say the least. Compared to Vercel it is seriously night and day with how simple you can get a repository running on the web.

- If I knew someone who wanted to get their GitHub repo working online and seeing a working website, I would immediately point them to Vercel as I believe it's one of the best ways to do what they want to do.
5 Ways To Center Content With CSS
Tags: css, webdev, tutorial, productivity
Published: 2022-03-14 02:04:54

📌 **The Absolutely Absolute way**

→ The old & easy way.

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

---

📌 **The Griddy Way**

→ Offers a grid-based layout system.

→ Making it easier to design web pages.


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

---
📌 **The Flexy Way**

→ Easy & Simple.

→ Flexible width/height of elements depending on available space.


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


---
📌 **The Table Way**

→ The very old way when tables were the only real way to structure HTML.


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

---
📌 **Power of Margins**

→ margin: auto on (flex or grid) item will not only horizontally center the element as it did in block layouts, but also center it in the vertical axis.


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

---
✨ Hopefully you find something new today!! ✨

→ It was just fun to see that CSS has so many varieties to do the same things just like we have in a programming language.

→ But then it depends on your personal preference & the 𝘀𝗶𝘁𝘂𝗮𝘁𝗶𝗼𝗻 when to use each of them.🤩✨
Armenian OCR in C# and .Net
Published: 2022-03-14 01:50:47

---
canonical_url: https://ironsoftware.com/csharp/ocr/languages/armenian/
--- 

_Other versions of this document:_

- [Հայերենում](https://ironsoftware.com/csharp/ocr/languages/armenian-hy)
- [125 More OCR Langauges](https://ironsoftware.com/csharp/ocr/languages/)

IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 language, including Armenian.

It is an advanced fork of Tesseract, built exclusively for the .NET developers and regularly outperforms other Tesseract engines for both speed and accuracy.

## Contents of IronOcr.Languages.Armenian

This package contain 120 OCR languages for .NET:

- ArmenianAlphabet
- ArmenianAlphabetBest
- ArmenianAlphabetFast
- Armenian
- ArmenianBest
- ArmenianFast

## Download

Armenian Language Pack [Հայերեն]

![Image 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3rh53j4j5lal0b733uw.png)

## Installation

The first thing we have to do is install our **Armenian** OCR package to your .NET project.

`PM> Install-Package IronOCR.Languages.Armenian`

## Code Example

This C# code example reads Armenian text from an Image or PDF document.

**C#:**
```cs
//PM> Install-Package IronOcr.Languages.Armenian
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Armenian;
using (var Input = new OcrInput(@"images\Armenian.png"))
{
    var Result = Ocr.Read(Input);
    Var AllText =  Result.Text
}
```

**VB:**
```
'PM> Install-Package IronOcr.Languages.Armenian
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Armenian
Using Input = New OcrInput("images\Armenian.png")
	Dim Result = Ocr.Read(Input)
	Dim AllText As Var = Result.Text
End Using
```
Bash: quotes inside quotes without printing'em
Tags: help, bash, programming
Published: 2022-03-14 01:26:50

```bash
contents="$(jq ".name = \"$writefrom_caproj_name\"" "$manifestwebapp_absolute_path")" && \
# credits from https://linuxconfig.org/string-concatenation-in-bash
echo "${contents}" > manifest.webapp
```

Special attention to this part:
```bash
"$(jq ".name = \"$writefrom_caproj_name\"" "$manifestwebapp_absolute_path")"
```

It simply doesn't works, as `"$manifestwebapp_absolute_path"` is using quotes inside quotes.

And using `\"$manifestwebapp_absolute_path\"` results in escaping the quotes BUT is also printing them.
So, how to use quotes inside quotes, somewhat like escaping them but without printing'em out?
Many thanks in advance! 🙏

**Note**: with proper answers turning into a solution, this question will be later turned into an explanation post.
Terraform Workspaces for Local AWS Development
Tags: aws, terraform, workspaces, dynamodb
Published: 2022-03-14 00:38:59

There are times when you need to develop the AWS API but could get away with merely imitating it. Using containers, we can stand up emulated AWS services. This can help when say… you’re completely disconnected or just want to save money while developing. But how do you continue with your typical IaC workflow? Terraform allows you to override the AWS API URLs by explicitly setting local endpoints. In this post, I’ll show you how to use containers and Terraform workspaces to develop the AWS API 100% locally!

#### Define AWS Provider

We will initialize the provider block with our region configuration in our terraform directory. Then with the use of dynamic blocks, we can set individual endpoints. In this case, we want to configure the DynamoDB endpoint. If using [localstack](https://localstack.cloud/), you can expand this to a larger array of [services](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/custom-service-endpoints#localstack).

```terraform
provider "aws" {
  region = "us-east-2"

  dynamic "endpoints" {
    for_each = terraform.workspace == "local" ? [1] : []
    content {
      dynamodb = "http://localhost:8000"
    }
  }
}
```

### Create Dynamo Resource

```terraform
resource "aws_dynamodb_table" "workspaces" {
  name           = "workspaces"
  billing_mode   = "PROVISIONED"
  read_capacity  = 1
  write_capacity = 1
  hash_key       = "id"

  attribute {
    name = "id"
    type = "S"
  }
}
```



### Start dynamo docker container

` docker run --rm -d -p 8000:8000 amazon/dynamodb-local`

### Create and Select Workspace

If this is the first time, you will want to create the local workspace:

`terraform workspace new local`

Otherwise, if switching between local and the default workspace

`terraform workspace select local`

#### Run Terraform Apply

```bash
~ terraform apply                
...
aws_dynamodb_table.workspaces: Creating...
aws_dynamodb_table.workspaces: Creation complete after 0s [id=workspaces]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
```

Now we can validate the table exists locally and not in AWS

```bash
### Remote
~  aws dynamodb list-tables
{
    "TableNames": []
}
### Local
~ aws dynamodb list-tables --endpoint http://localhost:8000
{
    "TableNames": [
        "workspaces"
    ]
}
```

### Provision in AWS

To provision the resource now in AWS you can switch back to the default namespace, and run terraform apply again.

```bash
~ terraform workspace select default
```

```bash
~ terraform apply -auto-approve                                   
...
aws_dynamodb_table.workspaces: Creating...
aws_dynamodb_table.workspaces: Still creating... [10s elapsed]
aws_dynamodb_table.workspaces: Creation complete after 13s [id=workspaces]
```

```bash
~ aws dynamodb list-tables
{
    "TableNames": [
        "workspaces"
    ]
}
```
DiagnosisAPI_UI MVC web application to use Diagnosis API
Tags: webdev, mvc, webapi, javascript
Published: 2022-03-14 00:27:15

SmrtX provides an API (Application Programming Interface) for patient preliminary medical diagnosis that can help you implement an intelligent symptom checker and Lab Test analyzer for your healthcare medical application. When you incorporate Diagnosis API within your healthcare web-application it will have the same functionalities like presented in DDxHub Diagnosis System (https://ddxhub.azurewebsites.net/). This is an alive example of implementation. By testing the DDxHub Diagnosis System you can see how global companies, as well as startups, have used it to enhance their business and support surrounding their patients and healthcare organizations.
The GitHub repository: https://github.com/Rustemsoft/DiagnosisAPI_UI

When you transmit to our web service a basic patient health data (such as Blood test results and symptoms), our AI inference engine will analyze the data and provide you with a list of the most likely health conditions. We get this according to the complex statistical algorithms we use to make medical diagnosis. Learn more: http://smrtx.com/ApiDoc_index.html
Vercel Site Deployment
Published: 2022-03-14 00:18:29

####**Vercel**
Vercel is a tool used to deploy and test static sites.  It allows developers to complete these actions in a quick manner.  Users can link GitHub accounts to Vercel and import their projects.  After importing, these projects can be deployed automatically.  This means that Vercel will update the deployment as changes come in. 



To learn more about how this happens, check out the article and documentation listed in the Sources section. 

####**How to get Started with Vercel**
[Vercel Installation](https://vercel.com/cli)

The first thing you are going to want to do is install Vercel via your command line.  To do so, follow the "Vercel Installation" link. 

Once you have successfully installed Vercel, you should link your GitHub account to deploy an existing project. 

![github link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9605ap1oi7z1qr4c8lqj.png)

Importing a repository is simple: just search for the one you want to deploy and click `import`

For the sake of an example, I used this [source] (https://github.com/btopro/ist-vercel-demo) to get set up with Vercel. In my terminal, I ran a `cd` to get into the directory where the code was housed.  Then, I ran `npm install` and `vercel dev`.  I pushed this code to GitHub, and was able to successfully use Vercel to generate the site. 


![vercel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpkmxvmpl861t23z55yf.png)

####**Publishing 11ty Sites via Vercel**

The process of publishing 11ty sites with Vercel is rather simple.  As before, simply import the desired repos and deploy.  Below are some photos of this working for me!


![11ty deploy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0cwdppsb4a2xw6x57khm.png)



![deploy2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsi7yos4ff5gk6sdioy8.png)


![deploy3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2j7qzmte16cz458qlqh4.png)


![deploy4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ygghzqhcqwo2qggdfjgk.png)



####**Vercel vs Other CI/CD Pipeline Approaches**
For myself, Vercel has been the simplest tool to use so far.  In my opinion, it is easier to understand and use than other approaches.  Vercel has the advantage of automatically updating as code is pushed out (with the help of GitHub).  In addition, the simplicity of this site allows for anyone with a basic understanding to use it for development!

In short, Vercel seems to be the most versatile tool used so far.  It has presented an easy development experience and it appears to be a very powerful site. 



####**Sources**
- [Article](https://www.redhat.com/architect/micro-frontend-architecture)
- [Documentation] (https://vercel.com/docs?redirected=1)
- [Sample Repo] (https://github.com/TaylorMorini/ist-vercel-demo)
Two modes of agile failure
Tags: agile, scrum, culture
Published: 2022-09-08 21:28:33

---
title: Two modes of agile failure
published: true
date: 2022-03-14 00:00:00 UTC
tags: agile,scrum,culture
canonical_url: https://jhall.io/archive/2022/03/14/two-modes-of-agile-failure/
---

I recently heard the claim “Agile is good for developers, but bad for management.” I don’t agree with that view, but it did get me thinking a bit about why someone might say that.

Over the years, I’ve also heard another common complaint about agile, which can be summarized as “Agile is good for management, but bad for developers.”

Obviously, both can’t really be true. But it seems that both are common views.

And I think both failure modes are the cause of essentially the same thing: Treating “agile” like a smorgasbord.

If we look at the [Manifesto for Agile Software Development](https://agilemanifesto.org/), and perhaps even more important, the associated [principles](https://agilemanifesto.org/principles.html), I think we see a pretty well-rounded approach to software development. It’s not detailed, to be sure, but it definitely pays attention to the needs of both business/management, as well as software developers. There’s no real favoritism going on. There certainly isn’t anything I can point to in either document that is “bad for management” or “bad for engineers”.

But, if we start to pick and choose which parts of the manifesto or principles we care about, at the exclusion of others, we can start to approach something lop-sided that favors either developers or managers.

For example, one of the arguments that “agile is bad for management” was the idea that “agile rejects deadlines”. But does it? “Welcome changing requirements” is not the same as rejecting deadlines. And it’s certainly not an excuse to ignore a deadline from management. The second principle says

> Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage.

The goal here is actually to help the customer, not ignore them!

On the other side, I hear complaints about things like “dailies worthless for developers” or “sprints are just mini-waterfalls” desgigned to make management feel better. Worthless dailies and mini-waterfalls aren’t in line with the spirit of the Agile Manifesto any more than the idea that deadlines are anathema.

Both views are based on a skewed history with agile projects. And at best, they’re the result of cherry-picking parts of agile, while ignoring others. In the worst case, they may be the result of just a complete misunderstanding of agile.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Azure - Easily get an Access Token for your REST API calls
Tags: azure, powershell
Published: 2023-09-13 15:41:20

---
title: Azure - Easily get an Access Token for your REST API calls
published: true
date: 2022-03-14 00:00:00 UTC
tags: Azure,Powershell
canonical_url: 
---

Using REST APIs on Azure is of course an essential skill for all Cloud users whether they are developers or administrators.

In a script it is often convenient to switch to a REST API instead of a Powershell cmdlet, for different reasons like the following:

- Use of a property not available on our version of Powershell module
- Updating a property of an object not easy to do in powershell

And of course to be able to call Azure REST APIs you need an access token, and for that there are several ways to get one.

If you have an old version of the powershell modules, you can always use this script :

```
$azContext = Get-AzContext
$azProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($azProfile)
$token = $profileClient.AcquireAccessToken($azContext.Subscription.TenantId)
$authHeader = @{
    'Content-Type'='application/json'
    'Authorization'='Bearer ' + $token.AccessToken
}

```

Or more simply if you forgot this piece of code, I advise you to go on the site of the documentation [Azure](https://docs.microsoft.com/en-us/rest/api/resources/resource-groups/list) and to test an API, you will have the possibility of recovering an access token.

And if you have a fairly recent module, you can use the following method:

```
$token = Get-AzAccessToken
$authHeader = @{
    'Content-Type'='application/json'
    'Authorization'='Bearer ' + $token.Token
}

```

And voilà you can call Azure REST APIs with your token as follows:

```
$restUrl = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups?api-version=2022-01-01"
Invoke-WebRequest -Uri $restUrl -Method GET -Headers $authHeader

```

We agree that it is much easier to remember.
Kubernetes setup Dockerhub secret
Published: 2022-04-05 04:37:26

---
title: Kubernetes setup Dockerhub secret
published: true
date: 2022-03-13 23:23:40 UTC
tags: 
canonical_url: https://cantillo.dev/posts/kubernetes-setup-dockerhub-secret/
---

When a Kubernete's pod or deployment pull the container image, the easiest way is to host the image in Dockerhub. However, sometimes you need to host the image in a private registry, therefore, you need to create a secret in Kubernetes to store the credentials and enable the pod to pull the image from the private registry.

### Step 1: Create a secret

Using the [kubectl command](https://kubernetes.io/docs/reference/kubectl/overview/), create a secret as follows:

```bash
kubectl create secret generic dockerhub \
    --from-file=.dockerconfigjson=~/.docker/config.json \
    --type=kubernetes.io/dockerconfigjson
```

The `create secret` command creates a secret with the name `dockerhub` and the type `kubernetes.io/dockerconfigjson`. The `--from-file` flag specifies that the secret should be created from the file `.dockerconfigjson` in the home directory of the user, and, the `kubernetes.io/dockerconfigjson` type is used to specify that the secret is in the format of a Docker configuration file.

### Step 2: Specify the secret in the Pod definition

In the spec section of the Pod definition, add the following lines:

```yaml
imagePullSecrets:
  - name: dockerhub
```

The `imagePullSecrets` field specifies that the pod should use the secret to pull the image from the private registry. The `name` field specifies the name of the secret. A complete example of the Pod definition is shown below:

```yaml
---
apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
  - name: my-app-container
    image: my-docker-hub-user/my-app-image
  imagePullSecrets:
  - name: dockerhub
```

### Step 3: Deploy the Pod

The Pod is now ready to be deployed in the Kubernetes cluster using the private image.

```bash
kubectl apply -f my-app.yaml
```
Mini project of Data Analysis
Tags: python, beginners, challenge, datascience
Published: 2022-03-13 23:14:56

Hi everyone. How are you?
That's a post of a challenge of Data analysis for beginners.
It's from a Python for Data Analysis course I'm doing.

What do we have for him?
We have 3 files of 2019 from an Enterprise (all data are fake).

- RegisterEmployer.csv
- RegisterClient.csv
- BaseServicesProvided.xlsx

What do we want to know?

1. Total payroll amount -> What was the total expenditure on employee salaries by the company?
2. What's the company's total revenue?
3. What's the % of employees who have already signed a contract?
4. Calculate the total number of contracts that each area of the company already signed
5. Calculate the total number of employees by area
6. What's the average monthly ticket of contract?

If you do the challenge, tell me in the comments if you liked it or if you have some doubts ;)

The feedback's on my GitHub: https://github.com/LeoDNascimento/Challenge-1E