teleren/devto huggingface dataset:
Freedom from the tyranny of metrics
Tags: devjournal, webdev, datascience
Published: 2022-08-08 21:39:00

_Originally published [on my blog](https://robinwinslow.uk/freedom-from-the-tyranny-of-metrics)._

A terrible tragedy hast befallen my most beloved domain:

![image](https://user-images.githubusercontent.com/519935/154802582-0584f7e9-ed64-4f50-835b-84ef54c61bb2.png)

My archrival Anthony Dillon hast improved [his domain](https://anthonydillon.com), and now it beats [our own](https://robinwinslow.uk)! This is, of course, unacceptable.

The culprit - Google!
---

My site's homepage only really had 1 single external dependency, `gtag.js` which of course set up my Google Analytics. Most sites have Google Analytics, but using it still makes me feel dirty. I really only do it so I can have this table:

![image](https://user-images.githubusercontent.com/519935/154801928-683b8401-8e2e-445d-94e1-aeae2699e475.png)

This is by far the worst performing part of the site, and pulls down my "performance" stat as low as 75% at times. You'd think Google could do a better job.

Tyranical metrics
---

Aside from the obvious complaints about how analytics [invades user's privacy](https://www.reuters.com/article/us-alphabet-google-privacy-lawsuit-idUSKBN23933H), and also likely [breaks European law](https://www.cpomagazine.com/cyber-security/france-finds-google-analytics-to-be-in-violation-of-gdpr-due-to-overseas-data-transfers/), I actually think these metrics carry a sigificant cost on me personally.

I wish I wrote blog posts at least every week, or ideally much more frequently. But if you look at my homepage you can see that I actually blog about once a year. This is at least partly because of the pressure I feel to perform. I fantisise about how each post will be ground-breaking and universally adored.

I'm also kind of addicted to [Twitter](https://twitter.com/nottrobin). On Twitter, metrics are right there. Every tweet has likes and retweets, and these really feel like the point. If your tweet doesn't have any likes, it's failed. I think this mindset has infected my psyche. It's why I take the same attitude to blog posts, and hence why I can't publish any.

Google Analytics is my crutch. It is the way that I can, at least in theory, see all my adoring fans coming to my site to worship my godlike content. And hence it's why I can never publish any content at all.

Moving on
---

So now I get to kill two important birds with one stone - free myself from caring about who actually reads my work, and also claw back the tiniest bit of self respect by not letting the wily [Anthony Dillon](https://anthonydillon.com) defeat me [in performance metrics](https://www.dareboost.com/en/comparison?reportIds=a_2621142e310b60b7e1a27376a&reportIds=a_2621142e310b60b7e1a27376b).

![robinwinslow.uk new performance](https://user-images.githubusercontent.com/519935/154802472-bca15264-fe7d-44aa-9023-a752bf8741a6.png)

Next step, quit Twitter. But steady-on, one step at a time.
Blogging from my phone with GitJournal
Tags: android, writing, productivity, devjournal
Published: 2022-08-08 21:34:00

_Originally published [on my blog](https://robinwinslow.uk/blogging-from-my-phone-with-gitjournal)._

I've been looking for a way to publish blog posts easily from my phone. I'm sure I would write a lot more if I could quickly jot down a post e.g. while lying on the floor next to my son's cot waiting for him to go to sleep.

My blog is made with [Jekyll](https://jekyllrb.com/), [GitHub Pages](https://pages.github.com/) and [Cloudflare](https://www.cloudflare.com/). Up to now, the only practical way to actually publish a new post has been to use git on my laptop. (Well, I *could* use github.com, but with all the necessary frontmatter and the poor mobile experience, it's not really practical).

I've been searching for a while for something that would let me simply publish from my phone. I actually saw [GitJournal](https://gitjournal.io/) in the Play store a couple of times, but I assumed it would only use GitHub to back up its own proprietary file format and so be useful.

Actually it's perfect. GitJournal lets you configure YAML frontmatter, the default folder etc. It's actually perfect for publishing posts to a Jekyll site.

Highly recommended.

This is my first post that I'm actually publishing with GitJournal, but I truly hope and expect it will be the first of many.
Counter app
Tags: codepen
Published: 2022-08-08 21:33:53

<p>This is a counter app. The app is for taking counts in different situations. It comes handy for situations when you have to take count and save all your counts. You can simply take counts by clicking on a stylishly designed increment button. The app also have features for saving previous counts/entries. The complete app contains three files which contain codes written in html, CSS and JavaScript.</p>

https://codepen.io/collection/kNwOJR
How to fix a npm install issue ?
Tags: node
Published: 2022-08-08 21:31:00

Sometimes it can be good to start from scratch, especially if you are opening an old / legacy project. Here are the steps to follow in order to have a working dependency graph again :

- delete the existing **package-lock.json** file
- ran the following commands:

`node -v ` (make sure you are using the same Node version than the pipeline that will build and deploy your project, if not see below)
`npm cache clean -f`
`npm install`

All should be good now.

> If you need to quickly switch to another version of Node than the one currently setup on your workstation, you can use this powerful package [n](https://www.npmjs.com/package/n) :
> `npm install -g n`
> `sudo n stable`
> `sudo n` (choose + Enter)
> `node -v`

---

Note : same remark if you need to run a `npm audit fix`, then make sure you are using the same Node version than the pipeline that will build and deploy your project
Git Useful commands
Tags: git, github, programming, beginners
Published: 2022-08-08 21:19:00

# Git useful commands

Our brain is better at processing data than storing it. So that's why I'm creating this document with one of the useful but maybe not so common commands to get the best for this wonderful tool

- Unstage all files you might have staged with git add
```shell
git reset
```
- Revert all local uncommitted changes:
```shell
git checkout .
```
- Revert all uncommitted changes:
```shell
git reset --hard HEAD
```
- Remove all local untracked files, so only git tracked files remain:
```shell
git clean -fdx
```
*WARNING*: -x will also remove all ignored files, including ones specified by .gitignore! You may want to use -n for a preview of files to be deleted.

- Delete all branches except the main one
```shell
git branch | grep -v "main" | grep -v "master" | xargs git branch -D
```
- Delete the most recent commit, keeping the work you've done:
```shell
git reset --soft HEAD~1
```
- Remove .git tracking
```shell
rm -rf .git
```
- Remove a file from a Git repository without deleting it from the local filesystem
```shell
git rm --cached .classpath
```


- If you have a sequence of commits

... - Commit1 - Commit2 - ... Commit5 <- HEAD
To squash Commit2 to Commit5 into a single commit, you can reset your branch to Commit1 and then commit again:

```shell
git reset --soft Commit1
git commit
```

- How to revert to origin's master branch's version of file
```shell
git checkout origin/master filename
```

- Resolve Git merge conflicts in favor of their changes during a pull
In a conflicted state, and you want to just accept all of theirs:

```shell
git checkout --theirs .
git add .
```

If you want to do the opposite:

```shell
git checkout --ours .
git add .
```
In pulling 

```shell
git pull -X theirs
```

In a conflicted state by file

```shell
git checkout --theirs path/to/file
```
Day 121: Back in business
Published: 2022-08-08 21:18:39

Hi!
This week started off great compared to the previous one it was not as productive as I wished it was but at least I accomplished some tasks learned few Figma tips and I also published another part on the Heroku Series how cool is that. as someone coming from a deep lazy week today was a success 

This week is expected to be a busy one as I'm supposed to work on new tasks and last week leftovers so I will need to put on the superman working mode. Tomorrow I will be focusing on this week tasks maybe get back to Flutter I don't know If I will be able to spare some time for Heroku series or Daily UI Challenge but if I spare some time that may be on the table as well but as for now that would be pretty much it.

Signing off...
Controlling web page based on information on the web page in conjunction with data in a libre calc document?
Published: 2022-08-08 21:10:08

Is it possible to track updating information on a webbpage and then take action (manipulating the web page)based on that information in conjunction with data that is in a libre calc document?  

One can say that there are two variables. One is on the webb page and the other on is in a libre calc document. The program has to keep track of both and then take action once the right conditions are fulfilled.  

Libre calc could run in an other tab in the webbrowser. 
or on the computer depending on whats is easiest or and the most functional way.
Angular Pipe Character Counter
Tags: angular, typescript, codenewbie, programming
Published: 2022-08-08 21:07:00

Have you ever needed a counter to get the number of characters in an input field and show the value in a label below the input, for example!?

It's normal to see that in a form field, like the image below!

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

So to resolve this "problem" I created a simple Angular pipe for do it!

* First I created the Pipe:

```typescript
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'counterCharacters'
})
export class CounterCharactersPipe implements PipeTransform {

  transform(value: string, ...args: unknown[]): number {
    if (value) {
      return value.length;
    }

    return 0;
  }

}
```

* After that, we need to declare the pipe in our module:

``` typescript
@NgModule({
  declarations: [
    MySiteComponent,
    CounterCharactersPipe
  ],
  imports: [
    ...
  ]
})
```

* And finally, We can just use the custom pipe in our span!

``` html
 <app-form-input-text labelDescription="Name"                                
                      formControlName="name"
                      inputName="Name"
                      #name                                                                                                                                  
                      [classInput]="applyError('name')"                                       
                      [control]="getField('name')"></app-form-input-text>
<span class="d-block">
  {{ this.name.value | counterCharacters }}/30
</span>
```
And now when we insert the value, the span tag show us the length of our input value!

That's it, thanks for reading!
Windows Server 2019 and AMD Radeon RX 6600
Published: 2022-08-08 20:46:27

---
title: Windows Server 2019 and AMD Radeon RX 6600
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
I was having some issues installing and updating the AMD Radeon RX 6600 driver on my windows server 2019. I was trying autoinstallers for drivers and everything and it was not working.

I was using a tool called easydriver to find and update my drivers. Those were not working very well as they kept using the latest RX 6600 drivers.

The steps:

1. To get it working I downloaded the windows 10-11 from https://www.amd.com/en/support/kb/release-notes/rn-pro-win-21-q4, an older version for it to work.
2. Once downloaded you need to run it, but it will fail.
3. What you'll then have to do is go to your driver manager, then go to your display driver, right click and click update.
4. Select manually find the driver folder, then go to the folder that was newly created under `C:\AMD\` this will most likely install properly.
5. Restart your computer and check if the 3D graphic card is working.
How to create your first composer package? 🐘
Published: 2022-08-08 20:43:00

## What is Composer?
Composer is a package manager for PHP. As with npm for Node.js and bundler for Ruby, it fills a similar role. It uses a JSON file to capture metadata about the project and the project’s dependencies.

## What is Packagist?
Packagist is a centralized Composer repository where anyone can register packages. It aggregates public PHP packages installable with Composer. Packagist currently contains almost 350,000 packages.

## Don't have an account?
Navigate to [packagist.org](https://packagist.org) and click Create account.

## 1. Create a project
- Create a folder named `nullthrows`
```
mkdir nullthrows
```

## 2. Initialize project as composer package
- In this process, you will be asked a number of questions such as the package name, name of the author, the description, minimum stability, the license, etc.

```
composer init
```

![CLI process](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb9fkai6wgsoyibmlciu.png)
 
- This process will generate a composer.json file.


## 3. Create a file named `nullthrows.php` with this content in `src` folder:

```
<?php

/**
 * @param mixed $value
 * @param string $message
 *
 * @return mixed
 * @throws Exception
 */
function nullthrows($value, string $message = null) {
    if ($value !== null) {
        return $value;
    }

    throw new Exception($message ?: 'Got unexpected null value.');
}
```

## 4. Add files under autoload in composer.json
```
{
    "name": "dobron/nullthrows",
    "autoload": {
        "files": [
            "src/nullthrows.php"
        ],
        "psr-4": {
            "dobron\\": "src/"
        }
    },
    "authors": [
        {
            "name": "Richard Dobroň"
        }
    ],
    "require": {}
}
```

## 5. Create a README.md (optional)
- You should provide a brief description of the repository and its functions.

## 6. Commit the code to GitHub repository
```
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin git@github.com:yourUsername/nullthrows.git
git push -u origin main
```

## 7. Submit package

[https://packagist.org/packages/submit](https://packagist.org/packages/submit)

![Packagist package submit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5t31i3f883s6z21ezrxv.png)
 

## You Did It!
Congratulations, you have published your first Composer package!
Why is coding so hard?
Tags: coding, programming
Published: 2022-08-08 20:40:00

I have purposefully titled this article in a such way to attract your attention.

If you are here you have to be really on the edge of quitting learning how to code. 

And this article won't tell you that you should continue anyways. To push your way through the obstacles and pain. 

You should quit right now. It is not an article to motivate you by checking your stubborness.

You really should quit. Here is the thing. Just read further. 

Coding is really, really hard. It is hard for everyone. Everyone struggles. 

What you feel has nothing to do with you. You are perfectly fine. 

But you should quit for real. Our brain is not a muscle. A muscle has to be injured to grow. 

Our brain does not work that way. When our brain is injured, it becomes depressed. It becomes ill. 

What you feel when ovewhelmed by coding, is your brain telling you it is enough. 

Take a break. I know you could go further. But your brain protects itself. It has above reason to do it, but also there is a second reason. 

We all think we learn when studying documentation, or writing code. 

But it is not true. When we do it, we only gather input for our brain. We gather some questions and answers. 

And when we gather to much, our brain says: it is enough. Now you will feel overwhelmed, frustrated. 

The brain tells you you should stop. Because it has all the data to actually learn how to code. 

It will learn when it will be relaxed. When you sleep. Or when you walk. Or when you meeting your family or friends. 

It is a completely background process that you don't have to worry about. 

To sum it up. Your brain has all the data. It is fully loaded. Give your brain time to actually do its job. 

Relax and enjoy the wonder. 

The next time just quit learning earlier.
Some useful VSCode extension to develop laravel app
Published: 2022-08-08 20:35:00

When I'm working with web development, VSCode is my first choice. Because it is lightweight, easy to use, has flexible UI/UX and most significantly, lots of extensions are available here. I bet, these extensions really help you to code and save your bunch of time. Some of these extensions are:

- **Laravel Blade Snippets**. Extension ID: onecentlin.laravel-blade

Most useful extension. Helps you to write syntax. It has autocomplete option. Such as, if you just write '_if_', it completes your if else block..

`  
@if ()
      
  @else
      
  @endif
`

- **Laravel goto view**. Extension ID: codingyu.laravel-goto-view

It helps you to navigate the file. 
`return view('<u>admin.cmessage.index</u>',['cm'=>$cm]);`
In above code, if you perform _cntr+click_ in windows or _cmd+click_ in mac, it will open **index.blade.php** file.

- **laravel-goto-components**. Extension ID: naoray.laravel-goto-components

Same as _goto view_. But it is for component file. It's pretty much useful when you work will **Livewire**

- **Laravel Artisan**. Extension ID: _ryannaddy.laravel-artisan_

This extension help you to run artisan command within visual studio

- **Laravel Blade formatter**. Extension ID: shufo.vscode-blade-formatter

One of the significant extension. Work with indent of blade syntax

- **HTML CSS Support**. Extension ID: _ecmel.vscode-html-css_

Help you to write html and css snippets.


Happy coding!!
Azure Key Vaults, SSH Keys, and You
Published: 2022-08-08 20:27:00

A quick post of how to work with ssh keys using MS azure.

Making a key pair:

```
ssh-keygen -t rsa
```

In this example, use the defaults. (Hit ENTER till the key is created.)

You should have a key in:

```
ls .ssh/id_rsa
```

Given an Azure Keyvault that you haver previously created, find that vault:

```
az keyvault list
```

For this example, let's call it "mykeyvault".

Upload the key.

```
az keyvault secret set --name sshkey --vault-name mykeyvault --file ~/.ssh/id_rsa
```

List the keys:

```
az keyvault secret list --vault-name mykeyvault
```

Now we can get the key:

```
az keyvault secret download --name sshkey --vault-name mykeyvault --file sshkey.pem
```

This should create a file which is the same as ~/.ssh/id_rsa. Prove it with diff.

```
diff ~/.ssh/id_rsa sshkey.pem
```
Connecting ionic angular app to WordPress using REST API.
Tags: ionic, wordpress
Published: 2022-08-08 20:22:19

ionic is an open-source UI tool-kit for building native and web app using HTML, CSS AND JS. It also has integrations for frameworks e.g Angular.
REST API makes it possible for developers to connect WordPress with other applications outside it's basic installation.
I'm currently building an App using ionic but stuck at connecting it to WordPress using REST API.

Any suggestions please?
Paracetamol.js💊| #180: Explica este código JavaScript
Tags: javascript, webdev, spanish, programming
Published: 2022-08-08 20:20:05

## **<center>Explica este código JavaScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark></center>

```js
const persona = {
  nombre: "Cris",
  saludo() {
    return `Hola, ${nombre}`
  }
}

window.nombre = "Ana";

console.log(persona.saludo()) // ?
```

A. `Hola Ana`
B. `Hola Cris`
C. `Hola window`
D. `Hola undefined`

Respuesta en el primer comentario.

---
Twilio Conversations client resilient setup
Tags: javascript, webdev, twilio, programming
Published: 2022-08-08 20:10:00

With Twilio Conversations SDK 2.0 release there is a new way of creating the client and setting up the event handlers. As stated in the documentation and contrary to previous versions, when the client is created in order to guarantee it has been properly initialized we must wait for the stateChanged event to fire and check the passed state to verify the initialization was completed:


```javascript
import { Client } from '@twilio/conversations';

const client = new Client(token);

// Before you use the client, subscribe to the `'stateChanged'` event and wait 
// for the `'initialized'` state to be reported.
client.on('stateChanged', (state) => {
  if (state === 'initialized') {
    // Use the client
  }
}
```



What if we have a momentarily unreliable connection? Simply by changing the network quality in Chrome's network tab to Slow the Twilio Client refused to initialize and that was it.

In order to make the process a bit more resilient I wrote a function that wraps the initialization event inside a promise that resolves when the client is successfully initialized and tries to recreate the client using an exponential backoff promise otherwise.

```javascript
//wait is a helper function that will wait a given number of seconds.
const wait = (ms) => new Promise((res) => setTimeout(res, ms));

const createTwilioClientWithRetries = (token, depth = 0) => {
    return new Promise((resolve, reject) => {
        //Create a new Twilio Client for the token.
        const twilioClient = new Client(token);

        twilioClient.on('stateChanged', async (state) => {
            try {
                if (state === 'initialized') {
                    resolve(twilioClient);
                }
                if (state === 'failed') {
                    if (depth > 5) {
                        throw new Error("Too many retries");
                    }
                    else {
                        dispatch(setError({
                            type: TWILIO_TOKEN_FAILURE,
                            message: "Twilio Token Error"
                        }));
                        await wait(2 ** depth * 10);
                        return await createTwilioClientWithRetries(token, depth + 1);
                    }
                }
            } catch (err) {
                reject("Too many retries");
            }
        });         
    });
}
```

Initially I tried to shut the client down with await twilioClient.shutdown() before calling the next iteration but it would prevent me from creating any further instances of the client afterwards for some reason.

Have fun!

Permalink: [https://www.estebansastre.com/create-twilio-client-join-conversation/](https://www.estebansastre.com/create-twilio-client-join-conversation/)