teleren/devto huggingface dataset:
Add a custom domain to your WordPress website
Tags: azure, tutorial, cloud, wordpress
Published: 2021-02-17 10:46:52

###### Originally published at [www.foteinisavvidou.codes](https://www.foteinisavvidou.codes/add-a-custom-domain-to-your-wordpress-website/)

In the previous tutorials, you created and configured a WordPress website hosted on Microsoft Azure, updated the version of PHP and connected to your app using FTP. In this tutorial, you will learn how to map a custom domain name to your website by using a CNAME record.

To complete the exercise, you will need:
* An Azure subscription.
* A WordPress website running on Azure or another Azure App Service app.
* Purchase a domain name and make sure that you have access to the DNS records for your domain provider.

### Check the pricing tier of the App Service plan
App Service Free hosting plan does not support custom domains. To connect a custom DNS name to your app, the app’s App Service plan must be a paid tier.
1. Sign in to [Azure Portal](https://portal.azure.com/), expand the left navigation panel and select **All resources**.
2. Select the **App Service** that you have created in the part 1.
3. In the left pane, select **Scale Up (App Service Plan)** in the Settings section.
4. If the app is in the **F1** tier, select one of the non-free tiers and click **Apply**. If your app isn’t in the **F1** tier, skip this step. 

### Connect your domain
You can use either an A record or a CNAME record to map a custom DNS name to your App Service. In this tutorial, you are going to add a CNAME record for the `www` subdomain.
1. In the left pane, select **Custom domains** under Settings.
2. Select **Add Custom Domain**.
![Add custom domain](https://www.foteinisavvidou.codes/wp-content/uploads/2021/01/1-custom-domain-1024x419.png)
3. Type the domain name (www&#46;your-domain&#46;com), make sure that **Hostname Record Type** is set to **CNAME** and click **Validate**.
![Add custom domain](https://www.foteinisavvidou.codes/wp-content/uploads/2021/01/2-validate.png)
4. To verify domain ownership, create a CNAME and a TXT record in your DNS provider using the following configuration:
![Validate ownership](https://www.foteinisavvidou.codes/wp-content/uploads/2021/01/3-domain-configuration.png)
5. Select **Validate** again. If the previous step is done correctly, you will see a green checkmark next to domain ownership. This means that you have successfully confirmed your domain ownership.
6. Select **Add Custom Domain**.
![Add custom domain](https://www.foteinisavvidou.codes/wp-content/uploads/2021/01/4-add-domain.png)

### Next steps
In the last tutorial of the “Host WordPress on Microsoft Azure” tutorial series, you will learn how to add an SSL certificate to your website using free App Service Managed Certificate. Stay tuned!
TLDR: counter_cache - field to count how many children a records has
Tags: ruby, rails
Published: 2021-02-17 10:40:40

---
title: "TLDR: counter_cache - field to count how many children a records has"
published: true
description: conter_cache in Ruby on Rails the easy way
tags: ruby, rails
canonical_url: https://blog.corsego.com/ruby-on-rails-counter_cache
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ufvyyw7hq13rg4s983o.png
---
Often you want to count how many child records a record has (`user.posts.count`, `user.comments.count`). 
Storing this data in a the database is more efficient (like `user.posts_count`, `user.comments_count`) than recalculating it each time. 
`counter_cache` gives us a way to recalculate the database field containing count of child records whenever a child record is created/deleted
### HOWTO
user.rb
```
has_many :posts
```
post.rb - add `counter_cache: true` to recalculate `posts_count` field in user table
```
belongs_to :user, counter_cache: true
```
console:
```
rails g migration add_posts_count_to_users posts_count:integer
```
migration:
```
add_column :users, :posts_count, :integer, default: 0, null: false
```
rails c - recalculate posts_count for all existing `posts` and `users`
```
User.find_each { |u| User.reset_counters(u.id, :posts) }
```
Running CodeceptJS in BrowserStack Automate
Tags: browserstack, codeceptjs, testing, automation
Published: 2021-02-17 10:33:27

Using a service like [BrowserStack](https://www.browserstack.com/) you can take your local automation tests to the skies. This is made possible by directing [CodeceptJS](https://codecept.io/) to point to BrowserStack instead of running locally.

The BrowserStack service required is [Automate](https://www.browserstack.com/app-automate), which runs tests using appium libraries on a plethora of mobile devices and operating systems. It also records tests by default, allowing you to review each scenario once complete. 

![Automate dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hiajapp5sh5od1fxwrh7.png)

To do so, you'll need to [upload your mobile app](https://www.browserstack.com/docs/app-automate/api-reference/appium/apps#upload-an-app). When successful, you'll receive an `app_url` in the response, which is the url to access the app in BrowserStack. This is how the devices provided by BrowserStack can access your application under test. 

```
{
    "app_url": "bs://c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "custom_id": "SampleApp",
    "shareable_id": "steve/SampleApp"
}
```

Next, you'll need to modify `codecept.conf.js` to run the tests in BrowserStack. Ensure you store sensitive info in an `.env` file and access using [dotenv](https://www.npmjs.com/package/dotenv).

```
  helpers: {
    Appium: {
      host: "hub-cloud.browserstack.com",
      port: 4444,
      user: process.env.BROWSERSTACK_USER,
      key: process.env.BROWSERSTACK_KEY,
      platform: "Android",
      app: process.env.BROWSERSTACK_APP_URL,
      desiredCapabilities: {
        realMobile: "true",
        device: "Samsung Galaxy S9",
        os_version: "8.0",
        networkLogs : "true",
      }
    }
  },
```

The new properties needed are:
* `host` : your browserstack host url
* `user` : your browserstack username
* `key` : your browserstack accesskey
* `app` : your uploaded app url
* `desiredCapabilities` : choose your device + appium settings. More can be found [here](https://www.browserstack.com/app-automate/capabilities?tag=w3c)

With this set, you're all good to go. No changes are need to your individual test files. When you're ready, run tests as you normally would and you'll see each test run tracked in the BrowserStack dashboard. 

<img width="50%" style="width:100%" src="https://media.giphy.com/media/l3vR6aasfs0Ae3qdG/giphy.gif">
Css Hsl colors introduction
Tags: css, webdev, html, beginners
Published: 2021-02-17 10:32:22

---
title: Css Hsl colors introduction
published: true
description: In this video we will take a look at how we can ditch hex colors and adopt the amazing Hsl and Hsla functions inside of our css.
canonical_url: https://since1979.dev/css-hsl-color-introduction/
cover_image: https://since1979.dev/wp-content/uploads/2021/02/hsl-color-intro-banner.jpg
tags: css, webdev, html, beginners
---

### How to use the Hsl color functions in Css

In this video we will take a look at how we can ditch hex colors and adopt the amazing Hsl and Hsla functions inside of our css.

{% youtube AL6mFBeJ2wM %}

Check out [this codepen](https://codepen.io/Since1979/pen/dyOYvJO) and take a view minutes to try it out for yourself.

I promise you'll love it.

### Subscribe and Follow

**[Subscribe to my Youtube channel.](http://www.youtube.com/channel/UCeyqA3y26RlnfUSx3ufgFoA?sub_confirmation=1)**

**[Follow me on Twitter](https://twitter.com/Vanaf1979)**

**Thanks for watching and stay safe**
Wednesday Links - Edition 2021-02-17
Tags: java, kotlin, microservices, jvm
Published: 2021-02-17 10:26:02

Pattern Matching in Java (6 min read) 🦓
https://nipafx.dev/java-pattern-matching

Why Namespacing Matters in Public Open Source Repositories (7 min read) 🏷️
https://blog.sonatype.com/why-namespacing-matters-in-public-open-source-repositories

Introduction to Reflectionless: Discover the New Trend in the Java World (6 min read) 🪞
https://dzone.com/articles/introduction-to-reflectionless-know-what-the-new-t

Building a layered modular Java application? Watch out for these! (11 min read)
http://andresalmiray.com/building-a-layered-modular-java-application-watch-out-for-these

Java AWS Lambda Container Image Support (6 min read) 🍰
https://rieckpil.de/java-aws-lambda-container-image-support-complete-guide

Metrics and Tracing: Better Together (13 min read) 🩺
https://spring.io/blog/2021/02/09/metrics-and-tracing-better-together

Reducing MD5 (and SHA) overheads (4 min read) #️⃣
https://cl4es.github.io/2021/02/14/Reducing-MD5-and-SHA-Overheads.html

Design Notes on Kotlin Value Classes (~1h read) 💲
https://github.com/Kotlin/KEEP/blob/master/notes/value-classes.md

Java and the modern CPU, Part 2: The unexpected effects of instruction execution (11 min read) ⚙️
https://blogs.oracle.com/javamagazine/java-and-the-modern-cpu-part-2-the-unexpected-effects-of-instruction-execution

JEP draft: Use UTF-8 as default Charset (5 min read) 🔣
https://openjdk.java.net/jeps/8187041

SpringOne - Sep 1–2, 2021 🤝
https://springone.io/
Book Launch: Writing Maintainable Unit Tests
Tags: books, tdd, unittests, softwaredesign
Published: 2021-02-17 10:25:49

I’m very happy to announce that I’ve finished writing my first book [Writing Maintainable Unit Tests](https://leanpub.com/writing-maintainable-unit-tests). What an amazing journey it has been. I would never have thought that I would be able to write a book. Well now, here we are.

[![Book cover of 'Writing Maintainable Unit Tests'](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihrkn4jy2j0uy7b75ns0.jpg)](https://leanpub.com/writing-maintainable-unit-tests)

The ebook has been published on LeanPub, which is available in PDF, EPUB and MOBI formats. There are six chapters:

- **Chapter 1** provides an overview of the different kinds of automated tests and how to apply a healthy mix in a code base. It also touches on the different flavours of Test-Driven Development.
- **Chapter 2** describes the characteristics and principles that make tests maintainable. It touches on a number of design principles like DRY, DAMP and the Single-Responsibility Principle.
- **Chapter 3** discusses the anatomy of automated tests and how a good structure is essential to keep them readable for our fellow software developers.
- **Chapter 4** demonstrates a number of patterns and techniques to keep tests decoupled from the production code. This is the longest chapter of the book.
- **Chapter 5** shows a number of patterns and techniques for writing clear assertions and observations.
- **Chapter 6** touches on some miscellaneous principles that are useful for writing maintainable and readable tests.

For more information, you can have a look at the full [table of contents](https://leanpub.com/writing-maintainable-unit-tests).

I’ve learned a lot over these past couple of years. It’s my hope that others can learn something as well from reading this book. As always, any and all feedback is very much appreciated.
Background jobs for Rails on GCP using Cloud Tasks
Tags: rails, googlecloud, ruby
Published: 2021-02-17 10:20:14

Hey guys, first post on dev.to. I thought I would introduce a gem we have developed to simplify the life of RoR people when deploying apps to Cloud Run.

Running background jobs on Cloud Run can be a pain because traditional job processors like Sidekiq or Resque are not an option if you want to go full serverless.

So we developed a library to do background jobs processing using Google Cloud Tasks. If you like Sidekiq, you should like Cloudtasker (we hope!)

Here is the link to the library: https://github.com/keypup-io/cloudtasker

And also a full blog post showcasing the gem: https://www.keypup.io/blog/cloud-tasks-for-ruby-and-rails
Cloud and Cloud Native - 2 different things
Tags: cloudnative
Published: 2021-02-17 10:12:06

Image Reference: https://www.mime.asia/standards-for-cloud-native-engineering-what-it-is-and-how-to-ace-it/

Often, I see folks get confused between Cloud and Cloud-Native. Or not even realise that these are different. Few years back, if you had asked me, I would be one such person.

Cloud to me, back then, meant a very simple thing.
It is virtualisation of infrastructure but with billing and automation support.

I did not know "Cloud-Native" existed. But, it does.
With the advent of containerisation (made popular by Docker) , followed by Container Orchestration (thanks to Kubernetes), cloud-native got born.
And now everything CNCF has/does, is meant for the "Cloud-Native" space.

It basically meant, for the s/w developer or any language programmer, that to run their application on cloud in an effective manner, they would need to know containers and orchestration. 
Without these additional technologies and frameworks, the true benefit of cloud (aka virtualisation, pay per use and maximising the infrastructure utilisation) could not be realised.

So, "cloud-native", in short, is the set of technologies that help applications/micro-services leverage cloud. 
And "Cloud" is what public companies like Amazon, Microsoft and Google provide (AWS, GCP, Azure) or may be your company provides internally for private consumption. Nothing but packaged infrastructure, in an easy to consume manner.
Cumulocity IoT LAB - Connecting your Raspberry PI using Thin Edge
Tags: iot, raspberrypi, demo, thinedge
Published: 2021-04-09 11:49:54

---
title: Cumulocity IoT LAB - Connecting your Raspberry PI using Thin Edge
published: true
date: 2021-02-17 10:07:26 UTC
tags: #iot, #raspberrypi, #demo, #thinEdge
canonical_url: https://tech.forums.softwareag.com/t/cumulocity-iot-lab-connecting-your-raspberry-pi-using-thin-edge/238926/1
---

[![](https://i.ytimg.com/vi/EJO3WVbTJUY/maxresdefault.jpg "Cumulocity IoT LAB - Connecting your Raspberry PI using Thin Edge")](https://www.youtube.com/watch?v=EJO3WVbTJUY)

Many production processes are high-speed related and thus require low delays between the generation of data and its processing. However, in order to keep track of the distributed devices and allow productive management, an IoT platform is a big enabler to support a fast overview, reactions to dynamic production states and distribution on different processing logic. The concept of sourcing this processing logic close to the origin of the data generation but also allows the management of these entities is what we call the thin edge. In this video, we are going to show you a little demo, how Cumulocity can be used with a thin edge.

> Give it a try: [Cumulocity IoT](https://www.softwareag.cloud/site/product/cumulocity-iot.html#/)

Link to Thin Edge git repository:

- [GitHub - SoftwareAG/cumulocity-thinedge-example: Cumulocity Example for a Thin Edge based application on Docker](https://github.com/SoftwareAG/cumulocity-thinedge-example)
- [GitHub - SoftwareAG/cumulocity-thinedge-web-app](https://github.com/SoftwareAG/cumulocity-thinedge-web-app)

[Read full topic](https://tech.forums.softwareag.com/t/cumulocity-iot-lab-connecting-your-raspberry-pi-using-thin-edge/238926/1)
Zephir repositories transfers
Tags: zephir, githuborg
Published: 2021-03-31 18:33:59

---
title: Zephir repositories transfers
published: true
date: 2021-02-17 10:00:07 UTC
tags: zephir,githuborg
canonical_url: 
---

All repositories related to Zephir, which were inside `phalcon` Github organization were transferred to `zephir-lang` organization. This transfer should occur in past, but due Github’s limitations at that time was decided to contain them inside `phalcon`.

<!--more-->

List of repositories that were transferred:

- [zephir](https://github.com/zephir-lang/zephir)
- [php-zephir-parser](https://github.com/zephir-lang/php-zephir-parser)
- [zephir-atom](https://github.com/zephir-lang/zephir-atom)
- [zephir-lexer](https://github.com/zephir-lang/zephir-lexer)
- [zephir-atom](https://github.com/zephir-lang/zephir-atom)
Hello Vite + React!
Tags: javascript, webdev, react, vite
Published: 2021-02-17 09:58:26

---
title: Hello Vite + React!
published: true
description: creating a React App with Vite.
tags: javascript,webdev,react,vite
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uh9i4uip619cvsn8yq15.jpg

---
##First of all introduce what is Vite ? 
Vite is a Next Generation Frontend Tooling created by Evan You, the creator of the open source JavaScript framework Vue.js.

##Why React?
So if it's from Vue.js you might wonder... how come I use it to create a React project if it represents that it would be the direct competition? Well, because Vite is an authoring tool, totally agnostic and the tool itself guides us to create a React application as we will see below. 

And I can already tell you that the result is impressive, the speed with which it is created and the speed with which you can start working on your project.

##How to get started?

```javascript
yarn create @vitejs/app
```
![create vite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76npl3r1vqffokftyzye.png)

##Put the name of the project.
In my case **richi.codes**

![name project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tghzpzin319qw0pjw2w3.png)

##Choose the template:

```javascript
Scaffolding project in /richi.codes....
? Select a template: ... 
  vanilla
  vue
  vue-ts
❯ react
  react-ts
  preact
  preact-ts
  lit-element
  lit-element-ts
```

**I choose React.**

![select template react](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ndzx34jzg66u467ir5ta.png)

##And that's it! 
We already have our project created now we just need to install and run it.

```javascript
  cd richi.codes
  yarn
  yarn dev

✨ Done in 130.42s.
```
##Ready really fast
![ready in 725ms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnp1i1ef99i214nkv9xf.png)

##Conclusion
I have to say that compared to create-react-app, Vite is really faster and the result is amazing. It also seems that the project size is smaller than create-react-app, so if you are going to create a new project, Vite is really an option to consider.

![running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8d882n3iuqk4cfusugza.png)
Wrapping text inside a circular shape
Tags: css, html, webdev
Published: 2021-02-17 09:57:10

<sup>**Find out more CSS tricks at [css-tip.com](https://css-tip.com)**</sup>

Yes, we are going to make a text wrap perfectly inside a circular shape. No JS, no SVG, no external plugin. Only few lines of CSS and a basic HTML structure.

## Let's go!

{% codepen https://codepen.io/t_afif/pen/dyOWVrr %}

### Explanation

```html
<div class="box">
  <i></i> 
  Lorem ipsum ..
</div>
```
```css
div.box {
  --s:450px;  /*Size of the circle */
  --p:15px;  /* padding */

  height: var(--s);
  width:  var(--s);
  border-radius: 50%;
}
.box i,
.box::before {
  content: '';
  float: left;
  height:100%;
  width: 50%;
  shape-outside: radial-gradient(farthest-side at right, transparent calc(100% - var(--p)), #fff 0);
}
.box i {
  float: right;
  shape-outside: radial-gradient(farthest-side at left,  transparent calc(100% - var(--p)), #fff 0);
}

```

#### [box]

A basic `div` element having `width=height` and `border-radius:50%` to create a *visual* circle. I said "visual" because it's not the one that will make our text wrap around.

#### [i] & [box::before]

 Two floating elements covering the whole div (full height and half width for each one) where we apply `shape-outside` to create half a circle inside each one. Below an illustration to better understand


![Text inside circular shape](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53z7aszlktn0wlinh36x.png)

The red element floating to the left will have half a circle on its right and the blue one will simply have the opposite. We adjust the radius of the circle using the variable `p` to simulate padding with the *visual* circle created by `box`.

### That's it!

We can easily extend this trick to consider different shapes. All we have to do is to adjust `shape-outside` and keep the symmetry.

Example with a Rhombus

{% codepen https://codepen.io/t_afif/pen/mdOmqgW %}

### Related posts for more shapes

[CSS Challenges - Custom text shape](https://css-challenges.com/custom-text-shape/)

[Stack Overflow - CSS rotate text by n degress, but not the boundary box?](https://stackoverflow.com/q/63274994/8620333)

[Stack Overflow - How to wrap text around a shape with border-radius?](https://stackoverflow.com/q/62437000/8620333)

[Stack Overflow - Containing text within border-radius blob](https://stackoverflow.com/q/62596002/8620333)
Telegram Scraper 2021
Published: 2021-02-17 09:47:03

Currently I have 20 Niche Telegram Groups with an average to date of 5000 members each. I am the only one who is allowed to post to avoid my groups looking like a spam groups. So whenever you pin a message on your group all the members are alerted :) .. So I repin like 2–3 times daily, but you are only allowed 5 pins, so delete the old pins and repin new messages or the same as the old ones :) Free traffic = $$$$
How to get members you ask?
Well:
You can buy members.. But it is hard to tell if they are bots of active! I tried this before and got fake members :(
You can pay for shouts from big niche related groups.. I do this a lot.
You can use python groups scraper and adder scripts like this one here:
Telegram Scraper-Adder-Messenger Software.

http://telegram-groups-scraper-adder.com/

So think out of the box and you do not have only rely on google ranking or Facebook ads.. If those methods did not work for you in 2020 try this method in 2021.
Do not forget telegram channels or a max of only 200 members however telegram groups has a max on 200000 members.. As for me I am growing my membership daily.. But just remember edit the settings of your groups so only YOU can post. Then post interesting posts with your links so they keep on coming back to read new stuff and not just leave your group.


For More Info Join Us On Our Telegram Groups.
https://t.me/tg_marketing_scripts
https://t.me/internetmarketingbots
https://t.me/mongoseomarketplace
10 Raesons Why You Should Use Laravel For Web Development
Tags: laravel, laraveldevelopment, phpframework
Published: 2021-02-17 09:44:09

Laravel is one of the popular PHP frameworks for developing web applications. Laravel's extraordinary features help to design web applications effectively, faster, and within the budget. Read More: https://laravellions.blogspot.com/2021/02/10-reasons-why-you-should-use-laravel.html