teleren/devto huggingface dataset:
Apply ContainerRelativeShape only to specific corners [SwiftUI]
Tags: swift, swiftui, ios, widgetkit
Published: 2020-10-07 12:42:32

This is an article how to round only specific corners using ContainerRelativeShape which have been appeared from iOS 14.

# What is `ContainerRelativeShape` ?

It will round corners of SwiftUI's view with suitable radius.
Corner rounded devices and UIs are increasing such as iPhone 11 and WidgetKit and more.

{% twitter 1276931917628219398 %}

# Purpose

| 1. Place it in the upper left | 2. Apply ContainerRelativeShape | 3. Make only upper left corner ! |
| -- | -- | -- |
|![](https://dev-to-uploads.s3.amazonaws.com/i/r9wtz0wf7s5a1ibdj2at.png)|![](https://dev-to-uploads.s3.amazonaws.com/i/i1e6oioosp88dn63hmxe.png)|![](https://dev-to-uploads.s3.amazonaws.com/i/0b483jqab3iz73zvnnop.png)|

This article describes the implementation of **3**.

- want to round corner to specific corners.
- want to use CornerRelativeShape of auto calculates not just rounded corner.

# Code

## Custom Shape

You create `ContainerRelativeShapeSpecificCorner` struct using `Shape` protocol and `UIRectCorner` optionset.

```swift
struct ContainerRelativeShapeSpecificCorner: Shape {

    private let corners: [UIRectCorner]

    init(corner: UIRectCorner...) {
        self.corners = corner
    }

    func path(in rect: CGRect) -> Path {
        var p = ContainerRelativeShape().path(in: rect)

        if corners.contains(.allCorners) {
            return p
        }

        if !corners.contains(.topLeft) {
            p.addPath(Rectangle().path(in: CGRect(x: rect.origin.x, y: rect.origin.y, width: rect.width / 2, height: rect.height / 2)))
        }
        if !corners.contains(.topRight) {
            p.addPath(Rectangle().path(in: CGRect(x: rect.origin.x + rect.width / 2, y: rect.origin.y, width: rect.width / 2, height: rect.height / 2)))
        }
        if !corners.contains(.bottomLeft) {
            p.addPath(Rectangle().path(in: CGRect(x: rect.origin.x, y: rect.origin.y + rect.height / 2, width: rect.width / 2, height: rect.height / 2)))
        }
        if !corners.contains(.bottomRight) {
            p.addPath(Rectangle().path(in: CGRect(x: rect.origin.x + rect.width / 2, y: rect.origin.y + rect.height / 2, width: rect.width / 2, height: rect.height / 2)))
        }
        return p
    }
}
```

## Usage examples

```swift
// Originally
Image("camera")
    .clipShape(ContainerRelativeShape())

// This article's
Image("camera")
    .clipShape(ContainerRelativeShapeSpecificCorner(corner: .topLeft, .topRight))

// Complete code sample
struct SampleView: View {
    var body: some View {
        Group {
            Image("camera")
                .resizable()
                .scaledToFill()
                .frame(width: 80, height: 80)
                .clipShape(ContainerRelativeShapeSpecificCorner(corner: .topLeft))
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
        .padding(8)
    }
}
```
Write API tests for HTTP PUT method
Tags: testing, tutorial, javascript, api
Published: 2020-10-07 12:37:30

Similar to the [HTTP POST](https://dev.to/automationbro/write-api-tests-for-http-post-method-4kki) method, the HTTP PUT method also takes in the request payload but instead of creating a new resource, it lets the user update the existing resource. 

The difference between the `PUT` and `POST` method is that `PUT` is idempotent i.e you can keep calling the same request multiple times but it won't have any side effects, unlike a `POST` request. 

Let's take a look at an example of a `PUT` request below - 

```javascript
  it('PUT /users/:id', () => {
    // data to update
    const data = {
      status: 'Active',
      name: `Luffy - ${Math.floor(Math.random() * 9999)}`,
    };

    return request
      .put('users/132')
      .set('Authorization', `Bearer ${TOKEN}`)
      .send(data)
      .then((res) => {
        expect(res.body.data).to.deep.include(data);
      });
  });
```
The above code will generate a result similar to this - 

```javascript
{
  code: 200,
  meta: null,
  data: {
    id: 132,
    name: 'Luffy - 7568', // name updated
    status: 'Active', // status updated
    email: 'dharitri_chopra@rogahn.name',
    gender: 'Female',
    created_at: '2020-10-05T03:50:06.247+05:30',
    updated_at: '2020-10-06T00:34:22.958+05:30'
  }
}
```
There you go, that's all we need to do to create an API test for the HTTP PUT method. 🙌

#### Check out this video to see a detailed explanation on how to work with the HTTP PUT method:

{% youtube d2mGuL4VlgA%}

You can also clone the [GitHub repo](https://github.com/automationbro/JavaScript-API-Automation-Tests) to access this code

***

#### To learn more about API testing, check out my free tutorial series here - 
https://www.youtube.com/watch?v=ZSVw3TyZur4&list=PL6AdzyjjD5HDR2kNRU2dA1C8ydXRAaaBV&ab_channel=AutomationBro
***

I hope this post helped you out, let me know in the comments below! 

Happy testing! 😄 

...

Subscribe to my [YouTube](https://www.youtube.com/channel/UCjugV5pnY6WjvTGYm7U1ucg?sub_confirmation=1) channel
Support my work - https://www.buymeacoffee.com/automationbro
Follow [@automationbro](https://twitter.com/automationbro) on Twitter
6 COMMON GYM MISTAKES TO AVOID

Published: 2020-10-07 12:34:30

We are in the last stretch of the year, and the time has come to consider the reasons for the following one. Inscribirse to the exercise center is maybe one of the most repeating goals, as to shed pounds after the special seasons voraciously consuming food is a shared objective.
Regardless of whether you start your exercise routine presently to diminish the impacts of occasion treats on your outline, or choose to spare it for the New Year, dodging these normal rec center errors will assist you with accomplishing better outcomes.
Clearly, getting more fit, conditioning muscles, and different outcomes you can get in the rec center will rely upon your dedication and constancy. Joining won't do enchantment on your figure. Determine on your schedule the days you will come to play out your everyday practice, go along with another person if important to remain persuaded, and don't stop for a second to attempt the sorts of exercises advertised. Some may agreeably astound you.

The rec centers have a group of mentors who are there to help you and answer your inquiries. Continuously inquire as to whether you are doing the activities well; if the weight is satisfactory, your stance is right. Notwithstanding sparing you wounds that can be not kidding and agonizing, this solid propensity will assist you with getting better outcomes with regards to shedding pounds and advancing in your daily schedule.

When utilizing the rec center hardware, you should feel good. On the off chance that you don't modify the seats, the backrests, or the measure of weight you can lift, not exclusively will you abstain from exploiting the impacts of the activity, yet you could truly harm yourself also. On the off chance that you don't have the foggiest idea how to do it, request help; It is smarter to ask than to be gotten on the telephone unsuspecting at that point be important for those amusing recordings that show novice's utilizing the exercise center gear seriously.

More info @ <a href="https://www.healthupp.com/common-gym-mistake/">common-gym-mistake</a>
Top 5 Cloud Security Tips You Should Know

Tags: cloudsecurity
Published: 2020-10-07 08:34:51

This article offers five tips to improve the security of your [cloud account](https://www.cloudanalogy.com/). Offers advice tailored to a variety of records, not just your cloud account, from email records to online cash accounts. The article clears up a bit how your security could be broken and how you can make it harder to break.

Protecting a recording online, for example, the cloud of programmers or wild power programs does not have to be a difficult task. Here are five tips that you can start using right away as part of an application to extend the security of your online recordings. Simple little changes to the way you do things online can potentially improve your online safety. The way you manage your recordings and passwords will make accessing your recordings online less demanding or more difficult for a programmer.

**Change your password like clockwork**
This is accomplished for several reasons. First of all, you need to change it regularly for safety reasons and, like clockwork, this implies that this is not an adaptation, but it also makes it difficult for programmers to get started without any preparation every time. you do it. You should also remember that old reps may try to control your structure, and changing your secret word at least at regular intervals will stop this.

**Control your email with neurotic energy**
It can be used to control the limit on each record connected to it, which integrates its management in the cloud, so you must be exceptionally vigilant and careful about the security of your email. You should start by changing your email address password every time you use your email in a possibly powerless system.

**Passwords containing real words are the most secure**
An inordinate number of people still use words in their passwords, and programmers, digital criminals, and animal energy projects will continually test them first. They even test anecdotal words, names, advertisements, and speeches on content. The words in your secret key will make it less secure and less demanding to hack.

**Some recordings will enter upper and lower case letters**
If the registries do, you must use uppercase and lowercase letters in your secret key. This makes your passwords much more ingrained as the programmer has to try many more combinations before finally breaking down her secret word. Try not to put all capital letters near the beginning of your secret word, as they will not be as powerful.

**Only use a mystery answer once**
Some programmers will enter your cloud account through indirect access and try to reset your password. This is especially true if your email address is hacked. In this way, you must make things as difficult for the [programmer](https://www.cloudanalogy.com/) as would be careful, and never use the same mystery answer more than once. If a site asks for your mother's last name by birth, please indicate it. If someone else asks you for your mother's original last name (as a mystery question), give the wrong answer and remember what it was. Again, you can save the mystery answer as long as you put it in a safe.
Accessibility and seo on webpages. Need help!
Tags: a11y, discuss, webdev, design
Published: 2020-10-07 12:10:54

# A while ago i read a post 
> "if your page/app don't take care about accessibility it is not a missing feature it is a bug"

At the moment i work on a lot of projects. Also on the webpage rework of the company i am working at.
I want to do some seo stuff and i want to make the page usable for every human. 

My problem: i can't find any good resource to learn where i have to put a alt text and how i have to write it. What are the std's to implement it for everyone. Would be great if someone could help me out! :)

Let's make the internet a better place together!<3
Daily Developer Jokes - Wednesday, Oct 7, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-10-07 12:00:14

---
title: "Daily Developer Jokes - Wednesday, Oct 7, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Oct%207%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259620ca4d.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Where does the pirate stash all of their digital treasures?

___A:___ RAR
 -->
Bitly URL Shortener for Wordpress
Tags: bitly, wordpress, codehaveli, url
Published: 2020-10-07 11:59:24

Codehaveli Bitly URL Shortener uses the functionality of Bitly API to generate bitly short link automatically from your WordPress dashboard when you publish a new post.

Codehaveli Bitly URL Shortener allows you to connect your WordPress Website to the Bitly API via access code.

Download From here: https://wordpress.org/plugins/codehaveli-bitly-url-shortener/

by [Codehaveli](https://www.codehaveli.com/)
Outlook PST to MBOX Converter Crack to Migrate, Convert and Export PST to MBOX
Tags: psttombox, convertpsttombox, migratepsttombox
Published: 2020-10-07 11:57:46

Get this Outlook <a href="https://www.mannatsoftware.com/stellar-outlook-pst-to-mbox-converter-win.html">PST to MBOX Converter</a> software which can easily convert complete files from Outlook PST to MBOX in simple way. With the help of this converter user can easily convert all pst files into mbox and transfer all the data to mbox of Thunderbird, Spicebird, SeaMonkey or Netscape mail client. This PST to MBOX Converter Software is a mutli utility software which has many incomparable features and function which make very smooth conversion process for users.  Technical or non technical both can easily use this software without have any technical or specific knowledge. 

Use this Discount Coupon ( MANNAT15DIS ) to get 15% discount on full licensed product.

Read more info: https://www.mannatsoftware.com/stellar-outlook-pst-to-mbox-converter-win.html
Outlook PST to MBOX Conversion Free - Migrate PST to MBOX
Tags: psttomboxconverter, convertpsttombox, psttomboxmigration, migratepsttombox
Published: 2020-10-07 11:49:14

When the User want to transfer data from Outlook PST to MBOX. In this situation you should take help this professional <a href="http://www.pcrecoveryutility.com/pst-to-mbox-converter.html">PST to MBOX Converter</a> Software to easily and instantly convert multiple and single PST files to MBOX format with all attachments. This has many following features which help the users to know more about this software. It also able to convert encrypted pst file into mbox format even if outlook pst file is password protected.

<b>Use this coupon code (SYSPRING30OFF) to get 30% discount on full licensed version.</b>

Visit here to know more: http://www.pcrecoveryutility.com/pst-to-mbox-converter.html
PST to MBOX Converter Free Online - Migrate, Convert PST to MBOX
Tags: psttombox, psttomboxconverter, convertpsttombox
Published: 2020-10-07 11:46:58

I would like to recommend you this professional Outlook <a href="https://www.filesrecoverytools.com/pst-to-mbox-converter.html">PST to MBOX Converter</a> Software which can efficiently convert and migrate single or multiple outlook pst files into mbox format in few steps. Moreover, After conversion, The resultant MBOX files can be imported into mbox clients such as Entourage, Thunderbird, PocoMail, Spicebird, Mulberry, Eurora, Netscape, SeaMonkey, OperaMail, ClawsMail, MozillaMail, Cone, Evolution, Sylpheed, Gnu Mail and Mutt email clients. All users both technical or non technical can easily use this software without any technical skill and this software is compatible with your all versions of Windows OS and support all types of MS Outlooks. 

Use this coupon code (SYSPRING30OFF) to get 30% discount on full licensed version.

Read more info: https://www.filesrecoverytools.com/pst-to-mbox-converter.html
Top 4 Incredible Benefits of Bitcoin (BTC)
Tags: blockchain
Published: 2020-10-07 11:39:52

Bitcoin (BTC) is a digital currency or cryptocurrency which is controlled by the decentralized network of users. Moreover, there are hundreds of cryptocurrencies are in active use today. By the way, Bitcoin is the most popular among the cryptocurrencies and used by most of the traders. Like traditional or fiat currencies, such as INR, USD, Bitcoin also have a value. The whole Bitcoin units can be divided into decimals. Presently, satoshi the smallest Bitcoin unit, or it can be referred to as 0.00000001 Bitcoin.

Bitcoin is one of the most popular cryptocurrency worldwide. It can also be used for purchasing goods that accept bitcoin payments. And also it can be exchanged to both the traditional as well as digital currencies, with the help of cryptocurrency exchange platforms like Koin Bazar, Binance, Paxful, etc. With the help of Bitcoin, you can use it for illegal purposes like buying illegal drugs from the dark marketplace.

There are many benefits of using bitcoins but the main advantage is that it has over traditional banks is the fact which allows international payments to go through without the worry of currency conversions.

<b>Benefits of having a Bitcoin (BTC):</b>

Moreover, Bitcoin has many benefits but here we going to look at the major benefits of bitcoin.

<b>Low Transaction Fee:</b>

The transaction fee for Bitcoin payments is very low when compared to credit and debit card payments. This should make it more advantaged for small business ventures.

<b>No Third-Party Involvements:</b>

The whole Bitcoin(BTC) transaction process is a peer to peer (P2P). There is no involvement of third parties. Nobody could freeze your assets.

<b>Ecosystem is Safe:</b>

Every Bitcoin wallet transaction is signed by the authenticated digital signature before it's sent to the blockchain. The entire process is safe for storing and exchanging your cryptocurrencies.

<b>Zero Risk Inflation:</b>

Using bitcoins, there is no risk of inflation. Inflation occurs when the Government proceeds more money over the year while decreasing the purchase by the people. But this system is created basically for creating the purpose of being finite. Without the chances of providing more currency, the inflation threat comes down to zero. This is a benefit for both the buyer and the seller.

<b>Wrapping Up:</b>

Being an emerging and innovative technology, we will say that Bitcoin has the potential of changing the economy as we know it before. Thus, we can conclude that the adoption of this technology for a minimal cost is the best one for the businesses and buyers.

So, Are you planning to <b><a href="https://www.koinbazar.com/">buy bitcoin in India</a></b> from the best cryptocurrency exchange platform? Visit Koinbazar and complete the basic procedures.
Jest unit tests location in vue
Tags: jest, vue, javascript, tdd
Published: 2020-10-07 11:32:09

I like doing test driven development in vue and jest. After doing this for a while I noticed that I don't like the fact that the unit tests live in their own directory apart from the implementation files: I always need some time to find them if I want to work on a component. Why not place the test files next to the component and javascript files as shown in the following directory listing?

    - components
        - HelloWorld.spec.js
        - HelloWorld.vue
        - Home.spec.js 
        - Home.vue
    - utils
        

As you can see it is very easy to find the test file and there is no confusion between test files and normal files due to the naming convention of tests (`*.spec.js`).

So how could we achieve this? It is very simple. We need to change the `testMatch` configuration of jest. When you created your project using the vue-cli and added jest as the unit testing framework, you will have a jest config file in the root of your project:

```javascript
// jest.config.js
module.exports = {
  preset: '@vue/cli-plugin-unit-jest'
}
```

The only thing you have to do is to add the proper `textMatch` entry to this file:

```javascript
module.exports = {
  preset: '@vue/cli-plugin-unit-jest',
  testMatch: [
    "**/src/**/*.spec.[jt]s?(x)",
  ]
}
```
When you now run jest, the test files next to the javascript files will be recognized. You will have to move all your tests next to the components, because with the new setting jest will ignore tests in the `tests/unit` directory. 

## How to find these settings?

I found out about this setting by examining the [jest config documentation](https://jestjs.io/docs/en/configuration#testmatch-arraystring). I also had a look in the initial config by running:

```
npx jest --showConfig
```
In the output I saw the initial configuration:

```javascript
 "testMatch": [
    "**/tests/unit/**/*.spec.[jt]s?(x)",
    "**/__tests__/*.[jt]s?(x)"
  ],
```
I copied this and just rewrote the first pattern in order to match files in the src directory. As I never use the `__tests__` directory I simply deleted this line in order to have no confusion where the tests should be placed.
Taskord for next Hacktoberfest
Tags: hacktoberfest, opensource
Published: 2020-10-07 11:31:17

I heard that there will be a chance GitLab will be a part of Hacktoberfest from 2021!

My current project Taskord is hosted on GitLab

Taskord is free open source social media for tasks! where users can post public and private todos, ask questions, and launch products. Taskord helps you to get things done together in public with the members of the community.

https://gitlab.com/taskord/taskord

Taskord mobile is hosted on GitHub

https://github.com/filiptronicek/taskord-mobile
How to Setup React Bootstrap
Tags: react, bootstrap
Published: 2020-10-07 11:31:12

---
title: How to Setup React Bootstrap
published: true
description: 
tags: react, bootstrap
//cover_image: https://direct_url_to_image.jpg
---

**Create new project in react** `create-react-app project-name`.

Step 1: **start project** `npm start` using this command into terminal.

Now you can install your bootstrap using `npm i --save react-bootstrap`. After you're done you should install bootstrap `npm i --save bootstrap` as well. 

Okey then after you're done with installing both **react bootstrap** and **bootstrap**. 

You can go to your react folder. Under `src > index.js`. That is your entry point for your web app. 

From there you should import bootstrap through this line here
```
import Bootstrap from `bootstrap/dist/css/bootstrap.css
```
You can save that. 

Now you can go to your `app.js` file. It's under **src** as well.

You can import anything bootstrap as an example. I'll just button because it's simple.  
`import { Button } from 'react-bootstrap'` 

**App.js** file

```

return(
  <Button bsStyle='success'> Hello </Button>
)
```

Reference - [React Bootstrap](https://react-bootstrap.github.io/getting-started/introduction)