teleren/devto huggingface dataset:
Poco F1 Restarts on Fastboot Amd
Tags: android
Published: 2023-08-14 17:24:19

---
title: Poco F1 Restarts on Fastboot Amd
published: true
date: 2023-07-08 19:15:20 UTC
tags: #android
canonical_url: https://finloop.github.io/posts/poco-f1-restarts-on-fastboot-amd/
---

## Poco F1 - Restarts on Fastboot (AMD)[<svg viewbox="0 0 28 23" height="100%" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"></path></svg>](#poco-f1---restarts-on-fastboot-amd)

I tried to flash custom recoery for my Poco F1 (codename “beryllium”). I installed ADB drivers and drivers for my phone. Windows device manager said everything was ok so I procedded and entered fastboot mode (Volume down + Power). I entered command:

```
fastboot devices

```

And the fastboot logo disappered and was replaced with text in top left corner: “Press any key to shutdown”. Then I remembered that the guide said this:

> Also, have a Xiaomi Account with Mobile Number of Sim1 ready for sign-in whenever required prior to Bootloader Unlocking and make sure you have a couple of Mobile Data MBs at least. And an INTEL PC/Laptop. For AMD you may need to do via WSL Ubuntu. If you encounter issues try to power off via the options available and boot straight to the fastboot or recovery depending in whichever stage you are.

Source: [[ROM][13][OFFICIAL] PixelOS [AOSP][STABLE][16/02/2023]](https://forum.xda-developers.com/t/rom-13-official-pixelos-aosp-stable-16-02-2023.4401621/)

I have AMD CPU so I had to do something else. I found a solution on XDA Developers forum.

## Solution[<svg viewbox="0 0 28 23" height="100%" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"></path></svg>](#solution)

Create a new \*.bat file and execute it. It should contain:

```
@echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f

pause

```

This will add some registry keys that will allow you to use fastboot on your phone on AMD CPU.

Credit: [[FIX] Fastboot not working on Ryzen CPU](https://forum.xda-developers.com/t/fix-fastboot-not-working-on-ryzen-cpu.4182879/)
Hi all of you i just joined dev community !
Tags: webdev, beginners, javascript, programming
Published: 2023-07-08 18:39:25

Hey there, fellow developers!

I'm thrilled to share some exciting news with all of you today. I have officially joined the dev community, and I couldn't be more excited about embarking on this journey alongside such a talented and passionate group of individuals.

As a developer, I understand the power of collaboration, the joy of problem-solving, and the endless possibilities that arise when we come together to create something remarkable. That's why I decided to join this community—to connect with like-minded individuals, learn from your experiences, and contribute to the collective knowledge.
Building Docs website has never been easier!
Tags: webdev, github, opensource, coding
Published: 2023-07-08 18:36:45


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

# What is DocsIt?
**[DocsIt](https://github.com/devmuhnnad/docsit)** is a tool or a template built on NuxtJS that helps you build a documentation website for your project. It is designed to be simple and easy to use. You can use it to build your own documentation website in minutes.

# Story beyond DocsIt
When faced with a problem, one of the most effective ways to generate ideas is through personal experience. That’s precisely how I conceived DocsIt, an open-source project designed to create documentation websites within minutes. With DocsIt, the focus shifts from website creation and coding to writing documentation using Markdown files.

During my involvement in an open-source project called ([Flutter-Bond](https://github.com/onestudio-co/flutter-bond)) where I was tasked with developing a documentation website, I sought an efficient and user-friendly solution. I aimed to avoid starting from scratch and handling the intricacies of UI development, Additionally I preferred it to be built with NuxtJS, I felt it was the perfect opportunity to build something as an Open-Source! as I always wanted to give to the community ❤

The journey of building DocsIt was a remarkable experience. I dedicated my efforts to ensuring its simplicity and ease of use. By utilizing a single configuration file, users can personalize their themes and customize their experience effortlessly.

But for sure I need your help to improve it! Fixing a bug, adding a feature or even a star would make difference for making it better.

DocsIt on Github: https://github.com/devmuhnnad/docsit
Docs of Docsit (LOL): https://docsit.netlify.app

Thanks!
TO-DO-LIST 00
Tags: javascript, webdev, beginners, tutorial
Published: 2023-07-08 18:04:08

`_In Motion starts`_ **Architecture**, a profession that is full of wonders but it's not just present in buildings or bridges. It's **EVERYWHERE** especially in software. If a building's structure isn't strong it's bound to fall. I won't let that happen to mine !!! `_In Motion continues_`
Discriminated unions in Typescript
Tags: typescript, javascript
Published: 2023-07-08 18:01:14

---
title: Discriminated unions in Typescript
published: true
description: How to use Discriminated unions type in Typescript and type your API response
canonical_url: "https://www.geodev.me/blog/discriminated-unions-in-typescript/"
tags: 
- typescript
- javascript

---

Discriminated unions, also known as tagged unions or algebraic data types, are a feature in TypeScript that enable developers to model and work with varying types of data in a concise and type-safe manner. They provide a way to define a type that can represent multiple alternatives, where each alternative has a unique discriminant property to differentiate it from the others. This discriminant property acts as a type guard, allowing the TypeScript compiler to narrow down the type and provide more accurate type inference.

By using discriminated unions, developers can create expressive and self-describing types that accurately capture the possible states or variants of a value. This is particularly useful when dealing with scenarios such as handling different response types from API calls, representing different error conditions, or modeling complex data structures with varying shapes.

I would like to show how we can implement such types. I had a chance to implement it while working on a API architecture in one of my side-projects.
So we have an API response that might have two results: success and error (rejected state). Both response have some common fields, but they also differ.
If a request succeed we will receive a `data` in some kind of shape. If a request fails we will receive an error message.
First, let's type the generic API response:

```typescript
type SuccessResponse<T> = { status: 'success', data: T, time: Date };
type ErrorResponse = { status: 'error', message: string, time: Date };
type RequestResponse<T> = SuccessResponse<T> | ErrorResponse;
```

I used generic here to describe the `data` if we have a success request. Now let's create a mock response for each of the states.
At the top of the file I created a type for the specific data we're requesting.

```typescript
type ResponseType = {
  users: string[];
  total: number;
};

const successResponse: RequestResponse<ResponseType> = {
  status: 'success',
  data: {
    users: ['Mark', 'Sophie', 'Pavel'],
    total: 3,
  },
  time: new Date(),
}

const errorResponse: RequestResponse<ResponseType> = {
  status: 'error',
  message: 'Comprehensive error message',
  time: new Date(),
}
```

Depending on the `status` property, the appropriate branch of the conditional statement is executed, providing a clear and concise way to handle different response types.
Using discriminated unions in this scenario allows us to effectively handle different API response types with type safety and readability.
Mounting Amazon EFS to an EC2 Instance: A Quick Guide
Published: 2023-07-08 17:33:20

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

1. Point 1: Launch an instance with the NFS port enabled
To mount Amazon EFS on an EC2 instance, ensure that the instance's security group allows inbound traffic on port 2049, the NFS port. This enables the necessary communication between the EC2 instance and the EFS service.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k012m7a3t79ew4v2k71k.png)
Point 2: Create EFS with the required security group attached
When creating an EFS file system, configure it to use the desired security group. This ensures that the EFS file system is associated with the appropriate security settings, including access to the NFS port.


Point 3: Mount the EFS volume to the EC2 instance
Connect to the EC2 instance, install the NFS client software if needed, create a directory for mounting, and use the mount command with the EFS file system details to mount it on the instance. Verify the mount and optionally configure automatic mount on startup.

In just a few simple steps, you can successfully mount an Amazon EFS volume to your EC2 instance, enabling seamless and scalable file storage and sharing capabilities.





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



-
Pull Request Validation for AWS CodeCommit using Lambda and CodeBuild
Tags: aws, docker, devops
Published: 2023-07-08 17:25:45


---
title: Pull Request Validation for AWS CodeCommit using Lambda and CodeBuild
published: true
description: Using AWS Developer tools to validate pull requests with custom actions
tags: aws, docker, devops
---
### what is it about

Need to lint Dockerfile or perform a CI test/check when a Pull Request is raised. Lets see how to build a solution for this on AWS Codecommit using Codebuild and Lambda to perform the check when a PR is raised or updated.

### overview of what we are building

![ci for python Dockerfile Lint](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvpnis51d2pvkvos4w5p.png)

We will take a sample solution here to perform a hado lint check on a dockerfile when a pr is raised in CodeCommit

#### Step 1 - Use the code from GitHub repo to create code build and lambda functions.

clone the repo 
https://github.com/uptownaravi/aws_codecommit_pr_validate.git
Note - add required region and account number and resource names in the files.

use the file buildspec.yaml to create the CodeBuild project
and refer the policy file codebuild_role.json for the essential permissions required ( CodeBuild needs access to CodeCommit to clone and comment on PR )

create lambda function using lambda_function.py and for the policy required check file lambda_iam_role.json ( Permission to start CodeBuild Project )

#### Step 2 - Create event bridge that connect all the parts together

create an event bride rule to trigger when a pr status update change occurs.

sample for the event.

```json
{
  "source": ["aws.codecommit"],
  "detail-type": ["CodeCommit Pull Request State Change"],
  "resources": ["arn:aws:codecommit:< region >:< account number >:< 
 repository name>"]
}
```

Add the target as the lambda function which was created in the above step.

#### Step 3 - Raise a PR and check if Dockerfile is linted and comments are being added

once you raise PR in CodeCommit the event bridge rule reacts to that. Lambda function runs and collects the information required to do the CI test/check. Starts the code build with the information as override parameters and environment values.
Then Code Build runs the hado lint on the Dockerfile adds the result to CodeCommit through aws cli commands.

Comment made in pr after the check
![PR with updated comment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jr793f0k0viax7et8xl6.png)

#### Step 4 - Customize for further CI test for pull requests

we saw one sample of Dockerfile file check, this solution can be extended to add different types of test or checks on creation/update of pull requests.

Thank you for reading. Please comment if any suggestions to improve.
Shopy — Best eCommerce Bootstrap 5 Template 2023
Tags: webdev, beginners, programming, news
Published: 2023-07-08 16:52:49

Bootstrap 5 eCommerce template called Shopy. It is a fully responsive template that can be used for any kind of online stores, such as electronics, fashion, mobiles, computers, beauty and health, shoes, jewelry, books and audibles, movies and games, televisions, etc.

An [eCommerce bootstrap 5 template](https://www.pxdraft.com/product/shopy-ecommerce-bootstrap-5-template/) is a pre-designed layout or theme specifically tailored for building an online store or eCommerce website. It typically includes various components, such as product listings, shopping carts, payment gateways, and other elements necessary for running an online business. Templates like Shopy provide a starting point for designing and developing an eCommerce website, saving time and effort in the design process.

Bootstrap is a popular front-end framework that helps in building responsive and mobile-first websites. It provides a collection of HTML, CSS, and JavaScript components and utilities, allowing developers to create modern and visually appealing web interfaces. Bootstrap makes it easier to create responsive designs by providing a grid system, responsive breakpoints, and a wide range of pre-styled components.

Bootstrap 5 is the latest version of the Bootstrap framework. It introduced several enhancements and new features compared to Bootstrap 4, including a smaller file size, an improved grid system, updated utility classes, new components, and better customization options.

While I cannot provide specific details about the Shopy template itself, you can visit the product page on [PXDraft](https://www.pxdraft.com/) to find more information, such as its features, design, and functionality. Additionally, you may consider exploring the template’s documentation or seeking user reviews to get a better understanding of its capabilities and suitability for your eCommerce project.

If you are looking for a responsive, multipurpose eCommerce template, Shopy is a good option. It is available for purchase on the pxdraft website.

Here are some additional details about the template:

It is built on Bootstrap 5, the latest version of the popular Bootstrap framework.
It is fully responsive and will look good on any device, from desktop computers to smartphones and tablets.
It is multipurpose, so you can use it for any online store.
It comes with several pre-made pages, including homepages, shop pages, product detail pages, checkout pages, login pages, and signup pages.
It is easy to customize, so you can change the colors, fonts, and other elements to match your branding.
It is well-documented, so you can easily learn how to use it.
If you are looking for a modern, responsive, and easy-to-use eCommerce template, Shopy is a great option.

See more product detail here: [https://www.pxdraft.com/product/shopy-ecommerce-bootstrap-5-template/](https://www.pxdraft.com/product/shopy-ecommerce-bootstrap-5-template/)
[Desafio] - Algoritmo Round-Robin Pica-Pau
Published: 2023-07-08 16:50:07

> Conteúdo original em https://twitter.com/zanfranceschi/status/1677719152545636352

---

Ei dev,

Pega esse desafio do algoritmo Round Robin do Pica-Pau!

Faça um algoritmo de distribuição/ciclo da mesma forma que o Pica-Pau fez com o lobo do episódio: "1 pra mim, 1 pra você; 2 pra mim (pegando 2 itens), 2 pra você (dando apenas 1 item)".

cc @sseraphini

↓

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

---

O resultado precisa ser algo como na imagem aqui.

Escolhi Python pro exemplo/guia porque é uma lang fácil de ler, mas obviamente faça com sua lang preferida.

Posta aí depois a presepada que você fez!

😗

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

---

Ah, me esqueci. Se quiser saber o que é um algoritmo round-robin que não seja zoeira, olha essa thread aqui.

https://twitter.com/zanfranceschi/status/1525916697332371457
null hipotez
Published: 2023-07-08 16:29:47

Null hipotezi, genellikle araştırmanın mantıksal tersini ifade eder. Örneğin, "iki tedavi yöntemi arasında bir fark yoktur" veya "bir grupla diğer grup arasında bir ilişki yoktur" gibi ifadeler null hipotezi temsil edebilir. Null hipotez, genellikle araştırmanın başında kabul edilir ve ardından verilerin analizi ile reddedilip reddedilmeyeceği test edilir.
CapCut Templates
Published: 2023-07-08 16:18:36

CapCut is a versatile video editing template that offers a wide range of features and tools to enhance your videos. With its intuitive interface and user-friendly controls, CapCut allows you to effortlessly trim, merge, and edit your footage to create [SE Acabo CapCut Template](https://procapcut.net/se-acabo-capcut-template/). You can apply filters, add text and stickers, adjust speed and color, and even create stunning transitions. Whether you're a beginner or an experienced editor, CapCut provides the flexibility and creativity you need to produce professional-quality videos that will captivate your audience.
Javascript Polyfill Array.map #3
Tags: javascript, programming, webdev, polyfill
Published: 2023-07-08 15:59:55

This problem was asked by Amazon.

**What is a polyfill ?**

In web development, a polyfill is code that implements a feature on web browsers that do not natively support the feature

Please implement your own Array.prototype.map().

**Example**

```
[1,2,3].myMap(num => num * 2) // [2,4,6]
[1, 4, 9, 16].myMap(num => num * 2) // [2, 8, 18, 32]

```

Note: Do not use native Array.prototype.map() in your code



**Solution**

```
if (!Array.prototype.customMap) {
  Array.prototype.customMap = function (cb, args) {
    const len = this.length;
    const result = new Array(len);
    if (typeof cb !== "function") {
      throw new TypeError(cb + " is not a function");
    }
    for (let i = 0; i < len; i++) {
      result[i] = cb.call(args, this[i], i, this);
    }
    return result;
  };
}
```

- This polyfill defines the .map() method on Array.prototype if it does not already exist natively. It implements the .map() functionality by:
- Checking if .map() exists, and if not, defining it
- Checking the this value is defined
- Getting the length of the array
- Checking if the callback is a function
- Handling an optional thisArg
- Creating a new array to store the results
- Iterating through the array using a for loop
- Calling the callback on each element and storing the result in the new array
- Returning the new array
What are design patterns?
Tags: webdev, devmarufurrahman, programming, design
Published: 2023-07-08 15:56:56


Just hearing the name design pattern can make you think it's either gimmicky or something extremely complicated.
The thing is neither. It is a very familiar name in Object Oriented Programming (OOP). We think of everything in OOP as objects. We will program like this, and new things will come up all at once - and we will solve them in a new way with our heads, it's not like that.

Many times the same kind of problem comes forward. Some smart people have deconstructed them and come up with very good solutions. These kinds of common problems can be solved very easily, very nicely, if you keep them in mind; There is no need to sweat or waste time as the solution does not have to be repeated. An example will make it clear.

Let's say I have a Manager class. I want my programming world to have only one manager in that software and he will do all the management alone. I can't create more than one manager even if another programmer or I want to.

The solution is very simple. I will always send a manager as a parameter wherever a manager is needed. And I will create a manager at the very beginning of the program - whether anyone needs it or not. I will also send a note to the rest of my team asking them to use my manager instead of making a new manager.

This is actually very messy and a very bad solution. Why or how we will send a manager as a parameter, why or I will memorize and make others, "There is no more than one manager, there will not be more than one manager, so the project manager will come and hit the house on the head" - such questions come to mind.

Another type of it can be a configuration class in place of the manager. It will contain some very important information, like how many other classes will work, dance, sing, etc.

If I want to change the nature of all the classes, I change an object of that configuration class. And the rest of the objects recognize that one configuration object - they will change their nature after seeing it. Now if the rest of the objects each recognize a different configuration object, then great danger! Static class can be a solution in this case, but it is not always used.
mtg proxy print
Published: 2023-07-08 15:53:19

When it comes to printing MTG proxies, it's important to note that creating and using proxies is not officially endorsed or supported by Wizards of the Coast, the company behind Magic: The Gathering. Proxies are unauthorized reproductions of Magic cards and are typically used as substitutes for expensive or rare cards in casual play or testing purposes **[mtg proxies](https://www.printingproxies.com/)**
Selecting CSS Classes Ending With The Same Name Using $= Operator
Tags: css, frontend, tutorial
Published: 2023-07-08 15:44:40

## Did you know you can select all classes that end with the same name in CSS using the powerful $= operator?

This technique is particularly useful when employing the **BEM** methodology.

Selecting multiple elements with the same class name in CSS can be time-consuming. Fortunately, the **$= operator** allows us to select all classes that end with the same name.

The **$= operator** enables us to select elements that have an attribute ending with a specific value. When applied to CSS classes, this means we can select all classes that end with the same name, regardless of the preceding characters.

If you're utilizing the **BEM** methodology, you'll likely have numerous classes that end with the same modifier name, such as **card--green**, **alert--green**, **button--green**, and so on. The **$=** operator permits you to select all classes ending with a particular string, as illustrated below:

```
[class$="--green"] {
  /* CSS rules */
}
```

In the example above, we're selecting all classes that end with **--green** and assigning them a green background color.

By employing the **$=** operator` in CSS, you can effectively select and style all classes ending with the same name, resulting in cleaner and more maintainable code.
Experiment with this technique in your projects to enhance organization and reduce redundancy.

Check out the thread on Twitter: [Here](https://twitter.com/khaleds_saif/status/1637129245016162306)