teleren/devto huggingface dataset:
PHP-Prefixer GitHub Action v1
Tags: actionshackathon21
Published: 2021-12-08 21:06:56

### My Workflow

To facilitate the usage of [PHP-Prefixer](https://php-prefixer.com/) (an automated online service to apply prefixes to PHP Composer dependencies), the Command-Line provides an ideal tool to integrate the prefixing service in any CI/CD context. As a reference implementation, we support the official [GitHub Action for PHP-Prefixer](https://github.com/PHP-Prefixer/php-prefixer-build-action).

Until [v0.0.7](https://github.com/PHP-Prefixer/php-prefixer-build-action/tree/v0.0.7), we worked with a simple Docker-based action. Now, we've just released the [Brand New php-prefixer-build-action v1](https://github.com/PHP-Prefixer/php-prefixer-build-action/releases/tag/v1.0.0). It has been completely re-written from scratch following these guidelines:

- Integrating [PHP-Prefixer CLI](https://github.com/PHP-Prefixer/php-prefixer-cli)
- Based on [GitHub Action Checkout - actions/checkout](https://github.com/actions/checkout)
- Powered by [GitHub actions/typescript-action](https://github.com/actions/typescript-action)
- Fully developed and tested on Typescript

The new Action combines **GitHub Action Checkout** and **GitHub Action Toolkit**. The GitHub Actions ToolKit provides a set of packages to make creating actions more straightforward and robust. The Action does a little bit of everything: clones a repository (with GitHub's checkout), calls the PHP-Prefixer service with a CLI, manages branches and tags, and commits the prefixed results. The final result has been a success so far.
 
### Submission Category: 

Maintainer Must-Haves

### Yaml File or Link to Code

```yaml
name: PHP-Prefixer

on: [workflow_dispatch]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Run PHP-Prefixer
        uses: PHP-Prefixer/php-prefixer-build-action@v1.0.0
        with:
          personal_access_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          project_id: ${{ secrets.PROJECT_ID }}
          token: ${{ secrets.GH_ACCESS_TOKEN }}
``` 


### Additional Resources / Info

You can check the action usage on this sample project: https://github.com/PHP-Prefixer/hello-wp-world/blob/master/.github/workflows/prefix.yml
Day 493 : Won't End Well
Tags: hiphop, code, coding, lifelongdev
Published: 2021-12-08 23:18:57

_liner notes_:
- Professional : Had a few wins today. Figured out the weird page getting longer, but nothing being added bug. Did some more testing and styling to make sure everything looks and works cool. Then I worked on and went through the slides for a presentation I have tomorrow morning. Made sure the accompanying demo still works. It does! Then I got ready to take part in a Twitter Space I was asked to be a speaker. I was pretty nervous, but learned a lot of others and added my 2 cents every once in a while.

- Personal : Last night, I got the final styling done for the front page of my current side project and I'm happy with it. Also did some research on how I would transfer the demo application to work on the new hosting platform. It's using serverless functions, so I needed to figure out how to set it up. I think I may have a good idea of how to do it. We'll see.

![View of Crater Lake, OR, United States from between 2 mountains and some pine trees in the foreground](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lrgocwiv76gk98113re8.jpg)

Going to work on my side project especially since I think I figured out how to get the back end working on this new hosting platform I've never used. Hoping to get a lot done, before I head to bed. Need to get up early to run through my presentation some more. It's pretty important and if I eff up, it won't end well. hahaha Not really, but I would feel really bad.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube caV4vW9AvN0 %}
¿Qué es Aprendizaje automático (machine learning)?
Published: 2021-12-08 18:46:53

## [Qué es el 'machine learning' y cómo funciona](https://estandar.io/mas-de-150-ideas-de-servicios-y-negocios-grcias-al-aprendizaje-automatico/)

El aprendizaje automático es el proceso en el que se utiliza una combinación de algoritmos de aprendizaje para que el computador sepa qué hacer en cada caso. La inteligencia artificial se utiliza para entrenar a los algoritmos de aprendizaje de forma que el computador pueda hacerlo. La inteligencia artificial es empleada para que el computador aprenda a solucionar problemas y realizar tareas de una forma similar a la de las personas. Para poder utilizarla, se necesita conocer el funcionamiento del cerebro humano.

El aprendizaje automático se utiliza para realizar tareas que requieren un alto nivel de inteligencia como la toma de decisiones. El aprendizaje automático es utilizado en el desarrollo de nuevos productos, como puede ser la creación de una aplicación para las nuevas tecnologías de Internet, por ejemplo.

La inteligencia artificial se utiliza para crear modelos de comportamiento humano. Después, estos modelos se usan para entrenar al computador para que se haga cargo de tareas que se pueden considerar humanas.


## [Machine Learning: definición, tipos y aplicaciones prácticas](https://estandar.io/mas-de-150-ideas-de-servicios-y-negocios-grcias-al-aprendizaje-automatico/)

La inteligencia artificial se utiliza para aprender a hacer cosas como:

-Realizar cálculos complejos.

-Hacer predicciones.

-Reconocer escritos.

-Realizar inferencias.

-Reconocer imágenes.

-Realizar traducciones.

-Hacer inferencias políticas.

-Crear nuevas ideas.

-Hacer cálculos de probabilidades.

-Crear nuevos problemas.

-Realizar diseños.

-Crear nuevas oraciones.

-Crear presentaciones.

-Crear arte.

-Crear música.

-Crear nuevas historias.

-Crear nuevos videojuegos.

-Crear nuevos programas de aplicación.

-Crear nuevos programas de videojuegos.

-Crear nuevas aplicaciones.

-Crear nuevas aplicaciones de Internet.

-Crear nuevos programas de Internet.
Solving day 8 of Advent of Code 2021 in JavaScript
Tags: challenge, adventofcode, javascript, video
Published: 2021-12-08 22:33:43

---
title: Solving day 8 of Advent of Code 2021 in JavaScript
published: true
description: JavaScript walkthrough of Advent of Code 2021 (day 8)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2021 in Javascript
---

{% youtube ueceglwuUGM %}
WUPHF 
Tags: actionshackathon21, theoffice, wuphf
Published: 2021-12-08 22:24:59


### My Workflow
WUPHF is a cross-portal messa
ging system! WUPHF is a reference to an episode of "The Office" ([More Information](https://en.wikipedia.org/wiki/WUPHF.com)). WUPHF uses a github Action build around the Python Apprise package. The package allows you to send a notification to almost all popular notification services.


Oh btw, we used the [matrix feature](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)! 😂😂

<video width="400" controls>
  <source src="https://i.imgur.com/puLuesW.mp4" type="video/mp4">
</video>

### Submission Category: 
Wacky Wildcards


### Yaml File or Link to Code
{% github emielvanseveren/WUPHF %}


### Additional Resources / Info
@niekcandaele
@emielvanseveren
innerText vs textContent
Tags: flatiron, javascript, beginners, node
Published: 2021-12-08 22:19:26

As I was going through some lessons about manipulating the DOM, we were presented with two ways to change the text of a node (or, more commonly, an HTML element):

**.innerText**
and
**.textContent**

While their functions appear to be similar - take the text in an node and change it to something else - they actually work pretty differently when taking a closer look.

**Let's start with .textContent**

From what I've learned so far, this method will return the text in a node while also taking spacing into consideration. It will give you all of the raw text inside the node, including some text that might be hidden from users. It also can be used on all node objects.

**Moving on to .innerText**

When you use .innerText, you will have returned to you _only_ the text inside the node returned to you without any additional spacing included. It will only give you the _visible_ text that gets shown to users. Interestingly, because of the way that .innerText takes the extra computing time to look at the layout, it can feel sluggish and is more demanding on your system. 


Looking at them side by side, it seems that using .textContent is generally the habit you want to create when you're changing some text in your DOM.

Oh, and I haven't really learned about .innerHTML yet, but maybe when it comes up I'll revisit and compare all three together.
Apama Advent Calendar - 08 Dec 2021 - Apama Connectivity
Tags: apama, iot, cumulocity, streaminganalytics
Published: 2021-12-10 12:25:49

---
title: Apama Advent Calendar - 08 Dec 2021 - Apama Connectivity
published: true
date: 2021-12-08 21:23:04 UTC
tags: apama, iot, cumulocity, streaminganalytics
canonical_url: https://tech.forums.softwareag.com/t/apama-advent-calendar-08-dec-2021-apama-connectivity/253799
---

_This is Day #8_ _of a short series of brief tips, tricks, hints, and reminders of information relating to the Apama Streaming Analytics platform, both from Software AG as well as from the community._  

Check out the original post in the [Software AG Tech Community](https://tech.forums.softwareag.com/t/apama-advent-calendar-08-dec-2021-apama-connectivity/253799) and learn about the many options to get Events In and Events Out!

_Note that some posts may be published a day or two early or late (e.g. Mon-Fri) so you may find you have bonus days with more than one post!_
Automobile Manufacturers, Models, And Specs Database
Tags: database, laravel, scraping
Published: 2021-12-08 21:13:17

A database which includes automobile manufacturers, models and engine options with specs.

## How to install and use Scrapper?

1. `git clone https://github.com/ilyasozkurt/automobile-models-and-specs && cd automobile-models-and-specs`
1. `composer install`
3. Get a copy of `.env.example` and save it as `.env` after configuring database variables.
4. `php artisan migrate`
5. `php artisan scrape:automobiles`

## Data Information
* 119 Brand
* 6681 Model
* 28400~ Model Option (Engine)

### Brand Specs
* Name
* Logo

### Model Specs
* Brand
* Name
* Description
* Press Release
* Photos

### Engine Specs
* Name
* Engine -> Cylinders
* Engine -> Displacement
* Engine -> Power
* Engine -> Torque
* Engine -> Fuel System
* Engine -> Fuel
* Engine -> CO2 Emissions
* Performance -> Top Speed
* Performance -> Acceleration 0-62 Mph (0-100 kph)
* Fuel Economy -> City
* Fuel Economy -> Highway
* Fuel Economy -> Combined
* Drive Type
* Gearbox
* Brakes -> Front
* Brakes -> Rear
* Tire Size
* Dimensions -> Length
* Dimensions -> Width
* Dimensions -> Height
* Dimensions -> Front/rear Track
* Dimensions -> Wheelbase
* Dimensions -> Ground Clearance
* Dimensions -> Cargo Volume
* Dimensions -> Cd
* Weight -> Unladen
* Weight -> Gross Weight Limit

Thank you.
Incident report (Postmortem) 
Tags: postmortem
Published: 2021-12-08 21:05:59

---
title: Incident report (Postmortem) 
published: true
description: A quick incident report from one of Bitwarden's Customer Success Engineers
tags: #postmortem
cover_image: https://i.imgur.com/7qTBLh2.jpg
---

## 8 December 2021

### Abstract
There was a discrepancy between Bitwarden’s status page (OK) and the actual service (KO) for an extended period of time.

### Timeline
|Date|Status|
|---|---|
|8 Dec - 10:35 CET|The Customer Success team reports that users having issues logging in|
|8 Dec - 12:24 CET|Bitwarden’s status page is updated to “Investigating”
|8 Dec - 13:24 CET|The Engineering team makes changes to the content delivery network. Users are able to log in normally
|8 Dec - 13:29 CET|Bitwarden’s status page is updated to “Resolved”|

### Problem
The agent in charge of updating the status page had the status system’s credentials stored in Bitwarden itself. Given the issue the platform was experiencing, they could not retrieve the credentials.
Recent changes on Customer Success composition led to the backup agent not having the appropriate credentials to access the status system.

### Failsafe
Even tough we acknowledge this was a problematic situation, it's worth mentioning:

- Bitwarden’s status page was always available due to it being in a completely different infrastructure.
- There is a health check protocol in place to automatically report outages. Unfortunately, due to the nature of the issue, it did not trigger.
- We have redundant agents that are able to update the status page. Albeit, the actuation was slower than desired.

### Future solutions
#### Immediate actions taken
The immediate backup has now their credentials set up. 
The agent in charge of the status system, and the procedures now include that these kinds of credentials to communication services should not be stored in Bitwarden itself, in case of a similar outage.
#### Action items
We will be reviewing the status system health check to trigger in a similar scenario.
Bulletproof Express - Enterprise-Level Express.js
Tags: javascript, node, programming, express
Published: 2021-12-08 20:48:39

[Click Here to Access It](https://github.com/JVKdouk/bulletproof-express/)

I believe I am not the only who has read tens of express guides and never really found the perfect way of implementing it.

In fact, I am confident to say that every Node.js developer has read at least 5 to 6 different guides on writing Express applications. How to make it work is not really a problem nowadays. However, have you ever asked yourself what is the **right way** to do it? 

With that in mind, I decided to create a boilerplate that would summarize all the best practices used nowadays in the software industry, ensuring reliability, maintainability and scalability. This is what Bulletproof Express tries to accomplish. These are the features currently provided:

 - [x] Security (HTTP Parameter Pollution, Fingerprint, XSS...)
 - [x] Support to Prisma DB (Easily Swappable)
 - [x] Error Management
 - [x] Logging (Using Sentry)
 - [x] Component Structure (Features)
 - [x] Queries and Mutators
 - [x] Testing (Using Jest)
 - [x] Permissions
 - [x] TypeScript
 - [x] Multi-Auth Support (JWT Implemented)
 - [x] Cookie Parsing Supported
 - [x] Environment Variable Parsing
 - [x] Node.js Best Practices Compliant
 - [x] Fully Asynchronous Controllers
 - [ ] Seeding
 - [ ] Testing via Docker
 - [ ] Auto-Documentation (Swagger?)

## MVC into Components
This boilerplate implements a slightly modified version of Model-View-Controller Pattern. Instead of having a single file storing every endpoint of a controller, every controller is broken down into Queries and Mutators. Inside Queries, you will find operations that retrieve data (usually GET methods). Inside Mutators, you will find operations that change data (usually POST, DELETE, and PUT methods).
Queries and Mutators are joined together inside the controller-specific `routes.ts`, which in turn are joined by the upper-level router at `/routes/index.ts`.

## Node.js Best Practices
This repository is compliant with Node.js Best Practices ([Click Here](https://github.com/goldbergyoni/nodebestpractices) to access their repository). Security standards are put above any decision. Testing is easy to implement and broken into individual feature, integrating it with the rest of the code as it should be. If you feel like there is any violation of those best practices, feel free to open an issue.

## Special Thanks
Special thanks to the Spectrum Project ([Here](https://github.com/withspectrum/spectrum)) for laying the foundations to Bulletproof Express. Also, many thanks to Node.js Best Practices ([Here](https://github.com/goldbergyoni/nodebestpractices)) and Bulletproof React ([Here](https://github.com/alan2207/bulletproof-react)) for providing guidance on how Enterprise-Level Software should be written.
Acra. Features: Data masking
Tags: cryptography, security, encryption, database
Published: 2021-12-08 20:47:16

At [Cossack Labs] (https://www.cossacklabs.com/), we strive to go ahead of trends and blaze a most effective trail for our customers. So, we designed Acra as a powerful multi-layer security tool for fintech, neobanks, healthcare and critical industry companies to cover data security threats in one shot.

> *[Use Acra Community Edition for free] (https://github.com/cossacklabs/acra). Check out [Acra Enterprise Edition] (https://www.cossacklabs.com/acra/#pricing) tailored for solutions with high security requirements.*

##3️⃣ Data masking

Acra allows configuring [data masking] (https://docs.cossacklabs.com/acra/security-controls/masking/) to certain database fields. Data fields stay encrypted in the database, but look masked/anonymized when reading through Acra.

💡 Data masking is useful **whether anonymizing datasets for reporting or exchanging the data with untrusted third parties.** Acra supports full or partial data masking, allowing customization of mask format.

![Data masking. Acra by Cossack Labs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1pk8fvs4u2i00fa8j1a.png)

So, with data masking, **data stays encrypted, but could be easily shared** with untrusted parties without revealing it. 

🔥 Let’s explore that else you get in the same box with Acra database security suite, follow the series.
Can't use Web Share API to share a file in my React typescript App
Tags: typescript, webdev, javascript, react
Published: 2021-12-08 20:46:53

I am trying to run a WebApp which allows files sharing.
After few google search, I found Web Share API like the standard to do so.
According to the [documentation][1] it should works like this using plain JS

This is the code for html page 
```
<p><button>Share MDN!</button></p>
<p class="result"></p>
```
The code to share all sort "textbased" metadata:

```
let shareData = {
  title: 'MDN',
  text: 'Learn web development on MDN!',
  url: 'https://developer.mozilla.org',
}

const resultPara = document.querySelector('.result');

if (!navigator.canShare) {
  resultPara.textContent = 'navigator.canShare() not supported.';
}
else if (navigator.canShare(shareData)) {
  resultPara.textContent = 'navigator.canShare() supported. We can use navigator.share() to send the data.';
} else {
  resultPara.textContent = 'Specified data cannot be shared.';
}
```
The code above works fine, the trouble happens when I try to share files.

According to the documentation it should works like this:

```
// filesArray is an array of files we want to share (audios, images, videos, pdf)
if (navigator.canShare && navigator.canShare({ files: filesArray })) {
  navigator.share({
    files: filesArray,
    title: 'Pictures',
    text: 'Our Pictures.',
  })
  .then(() => console.log('Share was successful.'))
  .catch((error) => console.log('Sharing failed', error));
} else {
  console.log(`Your system doesn't support sharing files.`);
}
```

I started my code from this example and I never success to share a file.
My actual code using React and Typescript looks like this:

```
//some react code here


      const shareNow = async () => {
        let imageResponse = await window.fetch('https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', {mode: "no-cors"});
        let imageBuffer = await imageResponse.arrayBuffer();
        let fileArray = [new File([imageBuffer], "File Name", {
          type: "image/png",
          lastModified: Date.now()
        })];


       if (navigator.canShare && navigator.canShare({ files: filesArray })) {
          navigator.share({
            files: filesArray
          }).then(() => {
            console.log('Thanks for sharing!');
          })
          .catch(console.error);
        }

        
      }

//some react code here too
```

At this point, my typescript compiler yell at me.
Apparently, the **navigator** object has no method **canShare()**

[![The compiler yelling][2]][2]

I am new to typescript, but I don't understand how and why the navigator could have less attribute since TypeScript is JavaScript superset.

Anyone has an idea on how to solve that except running normal JS ?

Thank you for your time reading this, and I hope to thank you for your answers.


P.S: I also tried a react-component based solution, but all the component I found in open source which wraps Web Share API does not allow file sharing.


  [1]: https://developer.mozilla.org/fr/docs/Web/API/Navigator/share
  [2]: https://i.stack.imgur.com/9RzcJ.png
Working on AWS console during outage
Tags: aws, iam, outage
Published: 2021-12-08 20:35:01

### Situation
As yesterday December 7th a new AWS outage made headlines, it seems opportune to talk about some AWS Services that are global (and not only tied to one region endpoint) like IAM and S3. For some Cloud Operations teams, to face an AWS outage in some regions is to have blockers on their daily jobs. The purpose of this post is to show how to continue doing admin jobs during a partial outage. 

### Issue 
AWS reported issues with their APIs on North Virginia (us-east-1) region. And let’s suppose we are on a Cloud Operations team and we need to perform some tasks in AWS Console, like for example, create a S3 Bucket and create a new user that have access to the given bucket (all in region US East 1)… How will be supposed to perform those actions with AWS issue without losing all day?

### Steps 

1. Login into the [AWS Console](https://console.aws.amazon.com/) with your user and password. If you are redirected by us-east-1 region, go to your browser url and change it with:
`https://<region>.console.aws.amazon.com/`
where `<region>` is a valid AWS region (for example, in this case we’ll use the Ohio `us-east-2` region). 
![https://us-east-2.console.aws.amazon.com](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yl5nzxi4xoh15myxjv61.png)

2. So now we are logged into the AWS console successfully!  We can then go to `Services`->`IAM`.
![AWS Services and IAM menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/me2gweeqn01g01mjmynb.png)
Clicking on `Users` -> `Add users` we can create a new user and assign the `AmazonS3FullAccess` AWS Managed Policy (just an example, it can be any other permission).
![On IAM menu go to Users and click on create User](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fryl4wxxf3ao9n64a1xw.png)
![New AWS User with S3Full Access permissions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eis4zxu5st1rxt3l4753.png)
3. After creating our user, let’s create a new S3 Bucket  from where we can read/write data (keeping logged in a different region). So we can go to `Services`-> `S3`. 
![AWS Services and S3 menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3e3rpoi31c2855usqk2.png)
Then we create a new bucket. Provide a unique name for that S3 Bucket and then on the region select the `US East 1`. Then, go to the end of the page and click on `Create`. 
![Create S3 Bucket with us-east-1 region](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8v51140jv26m19gqnia5.png)

### Conclusion 
Voilà! We did our task but located on a different region! Although it is better to have AWS working 100% on all the regions, and that this approach cannot be applied on several services. This can be a temporal workaround to avoid getting stuck when performing some Cloud Operations tasks.