teleren/devto huggingface dataset:
Learning K8s
Tags: kubernetes, docker, opensource, beginners
Published: 2019-11-18 05:20:12

---
title: Learning K8s
published: true
description: Learn to understand kubernetes step by step. A simple repo for beginners
tags: Kubernetes, Docker, opensource, beginners
---

![Title](https://user-images.githubusercontent.com/24803604/67205502-87c43800-f42d-11e9-9941-2a27d5dea0fe.png)

This is just a simple demonstration to get a basic understanding of how kubernetes works while working step by step. I learnt kubernetes like this and made this repo to solve some problems that I faced during my learning experience so that it might help other beginners. We won't be going into depth about docker 😊 but will see sufficient content to get you basic understanding to learn and work with kubernetes. ✌️ Hope you enjoy learning. If you like it please give it a 🌟.

**Important** :- By seeing size of readme you might have second thoughts but to be honest if you work from start you won't experience any problem and learn along the way.

[Link to Github](https://github.com/knrt10/kubernetes-basicLearning)
How to Publish ASP.NET Core MVC Web application to Azure
Tags: azure, dotnetcore
Published: 2019-11-18 04:30:24

In this [tutorial](https://github.com/patricksameerajayalath/AzureTutorials/blob/master/How%20to%20Publish%20ASP.NET%20Core%20MVC%20Web%20application%20to%20Azure.pdf) I’m going to show how to:

•	Create an ASP.NET Core MVC Application 
•	Create an App Service Plan
•	Create an App Service
•	Publish the code to Azure 



![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6sihzrmsdp0mmuer0j5u.jpg)


You can find the PDF version of this tutorial [here](https://github.com/patricksameerajayalath/AzureTutorials/blob/master/How%20to%20Publish%20ASP.NET%20Core%20MVC%20Web%20application%20to%20Azure.pdf).

You can find all my Azure/.Net tutorials [here](https://dev.to/patricksameerajayalath) and [here](http://sameerajayalath.blogspot.com/).

Enjoy !!
Parallax and Z-index
Tags: html, css
Published: 2019-11-18 04:21:56

<h1><center>My Portfolio Site - Pt 3</center></h1>
********************************************************

I have been having fun with the image theme I put together for my portfolio site as I work on leveling it up overall. As I work on the next iteration of the site I decided to start all the way down to the background images, parallax effect, and animations before getting back into the informational content. 

For the theme- The Royal Ontario Museum in Toronto is one of my favorite museums and all of the images I will be using on the site were taken there. I have tons of photos that should work well together to keep a cohesive theme and add some unique imagery. 

For now, I'm pretty pleased with the background imagery and initial parallax effects. With an image overlay of the exterior of the museum, I was able to scroll some panels of sample text up from behind the museum while some panels are still scrolling in front of the museum. I put together a quick video of the progress so far. 

![vid](https://media.giphy.com/media/m94vzgqK181qAbtGav/giphy.gif)

*********************************************************
<h1><center> Take a look at the code! </center></h1>
*********************************************************

For the CSS I made use of the articles from my last post of recent resources- and a fair amount of trial and error. I'm still enjoying gulp and browser-watch for development on the frontend. 

{% gist https://gist.github.com/JaredHarbison/fffcc32a6c1d8ddbe9027989b82c17bb %}

The html is still very simple. I used AOS for the animations of the cranes, but I am experimenting with a different resource. As I start to work with newer text animations and layer a parallax effect on them it will obviously expand back out quite a bit.

{% gist https://gist.github.com/JaredHarbison/ca0abd4eda051b7d5e96cc8d30fd842e %}

*********************************************************
<h1><center> That's All Folks! </center></h1>
*********************************************************
Create Custom Pipe in Angular 8
Published: 2019-12-06 03:47:51

---
title: Create Custom Pipe in Angular 8
published: true
date: 2019-11-18 04:21:09 UTC
tags: 
canonical_url: https://www.itsolutionstuff.com/post/how-to-create-custom-pipe-in-angular-8example.html
---

Are you looking for create custom pipe in angular 8 than i will help you to how to create custom pipe in angular 8 step by step i will create two types of pipe in angular 8 i will create without parameters and with parameters pipe in angular 8I written step by step creating custom pipe in angu
Async function behaves differently in loop [SOLVED]
Tags: help, javascript
Published: 2019-11-18 03:55:29

---
title: Async function behaves differently in loop [SOLVED]
published: true
tags: help,javascript
---

I have very basic async function going on here. my primary function `"formatData"` is formatting some data from an array `"users"` . which are basically some `github usernames.`

This function formats the data in this way : 
```javascript
[
  { name: 'rocktimsaikia', followers: 12 },
  { name: 'aholachek', followers: 90 },
  { name: 'benawad', followers: 30 }
]
```
Very basic . But the issue is to get the `followers count` i created another `async` function `"getFollowers"` which extracts the followers count with given argument which is the `github user name` that i am providing in `formatData`.

Here is my code : 

```javascript
const getFollowers = async name => {
  const data = await fetch(`https://api.github.com/users/${name}`);
  const { followers } = await data.json();
  return followers;
};

const formatData= async () => {
  const users = ["rocktimsaikia", "aholachek", "benawad"];
  const result = await users.map(async (user) => ({
      name: user,
      followers: await getFollowers(user)
   }));
  return result;
};
```

But the function `formatData()` returns everything with a promise. What am i missing here ? please help !
Tech Lead Squad 💪 - What's on Tap This Week (11/18) - PLUS free training coming up on Saturday
Tags: career, leadership, techlead
Published: 2019-11-18 03:20:18

---
title: Tech Lead Squad 💪 - What's on Tap This Week (11/18) - PLUS free training coming up on Saturday
published: true
description: This week we're reviewing all the core teachings I've had over the past year leading up to a live Saturday morning training session. Join us!
tags: career, leadership, tech lead
---

Hey DEV tech leads!

So sorry--it's been [a few weeks](https://dev.to/michaelrice/tech-lead-squad-what-s-on-tap-this-week-10-28-1oci/) since I posted here at Dev.to, which is easily my most favorite community (besides the [Tech Lead Coaching Network](https://techleadcoaching.com), of course). 

This week, I'm going to continue with the format I've had for the past few months: three posts on the tech lead coaching mailing list and three podcasts.

**But we're going to do something shiny and new this week**: on Saturday, I'm going to run a free, [live training session on How To Be a Tech Lead](https://techleadcoaching.com/training). Just register to get on the list. I'll try to record it if I can get all the technology together. Hope you'll be the first to attend our first of, hopefully, many sessions.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5d6lng7lmpqms9p7p9vr.gif)

So this week's episodes are going to be focused on pulling everything together and making sure I've got the material ready for Saturday.

On **Monday**, we're going to focus on summarizing some of the main points about what tech leads do, how technical you should be, and why we need the tech lead role.

On **Wednesday**, we're going to explore the Four Core. We'll start with the first two: listening and defining technical visions. This is going to be a little new, because I'm going to go a little more technical than I have in the past. 

On **Friday**, we'll round out a discussion of the other two of the Four Core, having a high engagement level and tracking and adjusting. Both of these go pretty close together.

Going to be a fun week and funner weekend!
Seine.io filter out nudity, violence and racy content in one line.
Tags: vision, api, proxy, service
Published: 2019-11-18 03:17:58

As an app developer chances are that you prefer spending your time adding and perfecting features rather than managing the content posted by your users. In that case, [Seine](https://seine.io) is the perfect product for you.

## Make sure your user content is always adequate

Managing pictures that your users share can be time consuming.

That’s why with [Seine](https://seine.io) we developed a solution to automatically filter out **nudity**, **violence** and **racy** content.

We will change any suspicious content on the fly and replace it with a placeholder.

![content blocked sample](https://miro.medium.com/max/1918/1*CoiNIftlO2qg6B-_BO7tQw.jpeg)

## How to get started ?

On the [get starting page](https://seine.io/apps/get-started-app#devto), you will be invited to configure your first application.

    1. **App name**: Chose a name, we will create a subdomain with this name for you.
    
    2. **Host URL**: That’s where your content is hosted and where we need to look to display an image.
    Put the root folder url and make sure it’s accessible from the public.
    Example for:
    - AWS: https://s3-us-west-1.amazonaws.com/your-root-folder/
    - Google Cloud Platform: https://storage.googleapis.com/your-root-folder/

    3. **Protocol**: You have choice between HTTP or HTTPS.

Last step is the set up of your credentials, you know how it works.

You're done, time integrate into your application!

## One line integration

We really focus on making it easy for you to use. As a result, you have only one line to change.

Chances are that you’re serving pictures through an URL like this:
```
https://mysite.com/path/to/picture.jpg
```

Replace your domain by the one that Seine created for you on step 1:
```
https://yourapp.seinedn.io/path/to/picture.jpg
```
That’s it, you’re done. Any inappropriate content will now be filtered.

## Start for free, then pay as you go

There is no upfront cost on [Seine](https://seine.io)! Once your account is created you have access to a free tier allowing you to filter up to 100 images a month without any cost. No need to provide your credit card either.

Anything that passes this threshold, you can pay as you go and can stop whenever you want.

For the picture delivery optimization you are also covered: it is unlimited and free!

Find more information on our [pricing page](https://seine.io/pricing).

## Transparency policy

At [Seine](https://seine.io) we want to be as open as we can about what we are working on and where we are going. But we also want to develop what’s useful for you, so we encourage you to follow our [public roadmap](https://trello.com/b/I3RdypxA) and up vote the features that you want first or reach out to us if something is missing.
#NewGenMVP (2019-2020)
Tags: newgenmvp, microsoftmvp, mvponduty, ttt2bmvp
Published: 2019-11-18 02:47:59

HAVOC to Team Bravo, get into position. New missions being now.

#### Bravo One
#### Bravo Two
#### Bravo Three
#### Bravo Four
#### Bravo Five
#### Bravo Six
Top Social Media platforms
Published: 2019-11-18 02:25:27

October’s top #SocialMedia #apps by number of downloads 📲
1️⃣ @WhatsApp
2️⃣ @tiktok_us 
3️⃣ @facebook 
4️⃣ @messenger 
5️⃣ @instagram 
6️⃣ @bestSHAREit 
7️⃣ @clubfactoryapp 
8️⃣ @YouTube
9️⃣ @likee_official
🔟 @Snapchat
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/7vc6hs0rj1q5ek38pudy.png)
Check out: @SensorTower and
https://twitter.com/BrianHHough/status/1196162004026875912?s=19

Which is your fave? 
#EmergingTech #discuss
Casting integers to floats for float division in Hugo
Tags: hugo, jamstack
Published: 2019-11-18 00:01:09

---
title: Casting integers to floats for float division in Hugo
published: true
description: How to cast 
tags: Hugo, JAMstack
---

I recently needed to do float division on two integers in a site I built with the Hugo static site generator.

Normally if you divide two integers in Hugo, it will give you integer division.

For example, if you calculate `5 / 2` with integer division, it will give you a result of `2` instead of `2.5`. This is Hugo's default behavior, because both 5 and 2 are integers.

```
Integer division:

{{- $num1 := 5 -}}
{{- $num2 := 2 -}}
{{div $num1 $num2}}

{{/* Yields result of 2 */}}
```

In order to do **float division** in Hugo (or what my high school math teacher would consider *normal* division), at least one of the numbers you're dividing must be a float.

The easiest way to do this is to cast all the numbers you're using in your calculation as floats when you're declaring your variables.

```
Float division:

{{- $num1 := float 5 -}}
{{- $num2 := float 2 -}}
{{div $num1 $num2}}

{{/* Yields result of 2.5 */}}
```

You can also cast them at the time of using them.

```
Float division:

{{- $num1 := 5 -}}
{{- $num2 := 2 -}}
{{div (float $num1) (float $num2)}}

{{/* Yields result of 2.5 */}}
```

This will make Hugo use float division and yield `2.5` as a result. 

I hope this helps!
Getting into programming with classes
Tags: ruby, classes, methods
Published: 2019-11-17 23:53:07

There's a certain threshold that one must eventually cross when getting to grips with any language (although I currently can only speak from a basic grasp on ruby). You might be thinking, iterating over hashes perhaps? Or is this wrapping our heads around control flow and how to get data to travel properly between methods? Or perhaps even committing to memory - and coming to grips with the workings behind - methods *with* hashes?

Well, no, not quite. But hashes, arrays, strings and so forth respond to the methods that they do so because these methods are part of their *class*. 
The array class has it's own methods, the string class has it's own methods...and can even have a range of array methods called upon it, but that's beside the point (even if all too useful!). 
For you see, reader, one can make their *very own classes*, as follows:

*class SomeClass*
  *def initialize(argument, other_argument)*
    *@argument = argument*
    *@other_argument = other_argument*
  *end*
*end*

One might be lead to think there's little much else to making their *very own methods* but this, too, has some exciting quirks that it's important to get a handle on if one wishes to properly harness the potential of custom classes!

As you may have noticed, my example contains an initialize method - this is standard practice if one wishes to individualise the data held by instances (objects) belonging to the class (such as name, age, temperature, you name it!), and will run whenever you do 
"some_object = SomeClass.new"! 

The '@' symbol I've placed before the variable names in the body means that their assignment in the method will apply across the entire instance, rather than just that one method (remember that the only data methods will usually provide outside of themselves is that which is 'return'ed).

Of course we could set about coding methods to return each of these instance attributes we have set, but a much quicker way to be able to return them is as follows:

*class OtherClass*
   *attr_reader :argument, :other_argument*
   (initialize variable and so on)
*end*

With attr_reader, you're all set to return the value of any of the chosen instance attributes without having to code methods to return each and every one of them. However, if you want to be able to change these values you need attr_writer, and to do both you'll need attr_accessor.

From here you can write methods to make your classes do all kinds of things: maybe one of these instance variables is an array, and you want a method to push instances of some other class into it? Or maybe you want said instance to have a method to push itself when called upon it? Maybe a class called 'Villain' or 'Student' could hold a whole slew of information in the form of class attributes, allowing a whole different approach to the student directory project of yesterweek?

While I do have to admit that custom classes do still feel ever-so-slightly ominous in their novelty, I'm looking forward to really playing with the full roster of their capabilities in my journey through the world of code.
Day7:String and &str - 100DayOfRust
Tags: rust
Published: 2019-11-17 22:42:18

## String and &str

`String` is Rust's `String` type, where strings are saved in heap.

`&str` is a string slice, pointed to the real strings.

String literals are `&str`, they are saved at the "static storage" area in a program, so technically they are type of `'static &str`.

## As parameter

If a function takes `&str` as parameter, you can pass `String`, `&str` and String literals to it. For example:

```rust
fn test(&str) {
    
}

let s1 = String::from("hello");
// to pass String to this function, we need change it to string slice
test(&s1[..]);

// directly pass a string slice
let s2 = &s1[1..3];
test(s2);

// b/c string literals are &str, we can directly pass string literals
let s3 = "Hello World";
test(s3);
```

## Conversion

To change String to &str, we can use `&str[..]` like the above example.

To change string literals to String, we can use the `to_string()` function, for example `"hello".to_string()` or `String::from("hello")`;


## Example

You can infer if a string function returning String or &str by checking if the function changes the origin string letters.

For example, `.trim()` will remove the leading and trailing spaces, which means it can return a pointer to the original string starting with the first non-space letter and ending with the last ending space letter, it doesn't need to change the original string or create a new string.

While `.replace()` or the `to_lowercase()` method will need to create a new string to make the change, because just create a pointer pointing to the original string won't work.


```rust
fn string_slice(arg: &str) {
    println!("{}", arg);
}
fn string(arg: String) {
    println!("{}", arg);
}

fn main() {
    string_slice("blue");          // string literals are &str
    string("red".to_string());     // to_string return String
    string(String::from("hi"));    // String::from return String
    string("rust is fun!".to_owned());    // to_owned return String
    string("nice weather".into()); // Same as String::from
    string(format!("Interpolation {}", "Station"));  // Created a new String
    string_slice(&String::from("abc")[0..1]);  // Create a slice
    string_slice("  hello there ".trim());     // create a slice
    string("Happy Monday!".to_string().replace("Mon", "Tues"));  // Create a new String
    string("mY sHiFt KeY iS sTiCkY".to_lowercase());  // Create a new String
}
```
Blazor-Auth0 v2.0.0-Preview4 is alive!
Tags: blazor, auth0, dotnet, csharp
Published: 2019-11-17 22:28:39

<img src="https://raw.githubusercontent.com/henalbrod/Blazor.Auth0/master/src/Blazor.Auth0.ClientSide/icon.png" height="150" alt="Blazor Auth0 Library" align="right"/>

[Blazor.Auth0](https://github.com/henalbrod/Blazor.Auth0) Is a library for using the [Authorization Code Grant with Proof Key for Code Exchange (PKCE)](https://auth0.com/blog/oauth2-implicit-grant-and-spa/) with [Auth0's Universal Login](https://auth0.com/docs/libraries/when-to-use-lock) in Blazor SPAs.

The idea behind this is to have an easy way of using Auth0's services with Blazor (especially the client-side) without relying on javascript libraries.

https://github.com/henalbrod/Blazor.Auth0
Haml🤙 #1 #10 giorni introduzione 
Published: 2019-11-17 22:21:51

Oggi è il primo giorno circa Haml ciao, mi chiamo Karim Coda..
Amico/amica, 
Questo articolo riguarda il web design, il web design è alcune lingue che sono alcune risorse per informazioni sul web design.

https://en.m.wikipedia.org/wiki/Web_design?wprov=sfla1

Allora 
Ci sono tre lingue importanti che usiamo nel web design così è

Html:
https://developer.mozilla.org/en-US/docs/Learn/HTML

Css
https://developer.mozilla.org/en-US/docs/Learn/CSS

JavaScript
https://developer.mozilla.org/en-US/docs/Learn/JavaScript

Quando impari queste lingue pensi di essere diventato un designer professioniste/a

Esistono diverse tecniche in questi linguaggi che consentono di estendere e chiarire il design e chiarire il codice
Gli esempi Haml scss sass.... 

Vuoi sapere una volta che è haml

Haml è html Preprocessor 

Haml è un linguaggio di markup utitizzato prevalentemente con Ruby che descrive chiaramente e semplicemente l'html di qualisasi socumento web senza il codice inline

http://haml.info/docs/yardoc/file.REFERENCE.html

Alla fine aspetta il prossimo post che contiene esempi di Haml e grazie per aver letto questo e spero che i tuoi giorni saanno un successo

Fatemi sapere nei commenti qui sotto

Posta in inglese
https://dev.to/karimcoda65/haml-1-10day-introduction-5bjm

Seguimi
https://www.facebook.com/karim.coda99

https://www.instagram.com/karimcoda

https://vm.tiktok.com/HRduhe/

https://mediu.com/@karimcoda99
No more 💩 angular unit test / #2 Component logic
Tags: angular, typescript, testing
Published: 2019-11-17 22:19:50

You are looking for testing component template, see [here](https://dev.to/ruizalexandre/no-more-angular-unit-test-1-component-template-2b09).

⚠️ Use ng-mocks in your unit tests
More details after about this lib. Just keep in mind that it's awesome.

__What can we test in component logic ?__
* All Angular `Output()`
* All dependency calls

> __🤔 And what about a component method binded on a button (from html) and dispatch an action for example ?__
>
> This case (or similar case) is simply a template test (button interaction) __and__ a logic test (dispatch action when button clicked).

#### Testing a dependency call

```typescript
import { TestBed } from '@angular/core/testing';
import { YourComponent } from './your-component.component.ts';
import { MyService } from './your-service.service.ts';
import { MockRender } from 'ng-mocks';

describe('YourComponent', () => {
  let service: MyService;

  beforeEach(() => {
    TestBed.configureTestingModule({
      declarations: [YourComponent],
      providers: [MyService]
    });

    service = TestBed.get(MyService);
  });

  it('should call helloWorld', () => {
    spyOn(service, 'helloWorld');

    const fixture = MockRender(
        `<my-component (getData)="getData($event)></my-component>`,
        { getData: data => receivedData = data; }
    );
    fixture.detectChanges();

    const actionEl = fixture.debugElement.query(By.css('.action'));
    actionEl.triggerEventHandler('click', {});
    fixture.detectChanges();

    expect(service.helloWorld).toHaveBeenCalled();
  });
});

```

#### Testing an output

```typescript
import { TestBed } from '@angular/core/testing';
import { YourComponent } from './your-component.component.ts';
import { MyService } from './your-service.service.ts';
import { MockRender } from 'ng-mocks';

describe('YourComponent', () => {
  let service: MyService;

  beforeEach(() => {
    TestBed.configureTestingModule({
      declarations: [YourComponent],
      providers: [MyService]
    });
  });

  it('should outputs string', () => {
    let receivedData = null;
    const fixture = MockRender(
        `<my-component (getData)="getData($event)></my-component>`,
        { getData: data => receivedData = data; }
    );
    fixture.detectChanges();

    const actionEl = fixture.debugElement.query(By.css('.action'));
    actionEl.triggerEventHandler('click', {});
    fixture.detectChanges();

    expect(receivedData).toEqual('hello world');
  });
});

```


__Keep in mind one important thing, if you want to logic, use your template, don't call your logic with `fixture.componentInstance.yourMethod()` for example.__


I hope this article can helps you in your development. 🐼