teleren/devto huggingface dataset:
Docker Open Sources Docker Compose Spec
Tags: podcast, docker, devops
Published: 2020-04-23 06:56:42

---
title: Docker Open Sources Docker Compose Spec
published: true
date: 2020-04-14 12:00:00 UTC
tags: podcast, docker, DevOps
canonical_url: https://share.transistor.fm/s/e24f5bc0
---

{% spotify spotify:episode:5GDpdettkvLBpWFveSCUeu %}


Docker announcement - [https://www.docker.com/press-release/docker-open-sources-compose-specification](https://www.docker.com/press-release/docker-open-sources-compose-specification)   
Docker Compose Spec - [https://www.compose-spec.io/](https://www.compose-spec.io/)  
Awesome Compose - [https://github.com/docker/awesome-compose](https://github.com/docker/awesome-compose)  
Kompose - [https://github.com/kubernetes/kompose](https://github.com/kubernetes/kompose)  
Compose on Kubernetes - [https://github.com/docker/compose-on-kubernetes](https://github.com/docker/compose-on-kubernetes)
What happened with Dirble
Tags: ruby, api, internetradio
Published: 2020-04-14 11:58:36

I am the former owner and the founder of Dirble. I worked on Dirble from 2011 to 2019 on it with around 4–5 months in profit. The rest I paid from my own pocket to keep the whole service up and running.

Dirble was an amazing service, built to be your backend to handle all internet radio stations with search, categories, played songs and album covers. first it was built in PHP with Codeigniter and then in ruby with Ruby On Rails. A lot of systems and apps used Dirble to handle thousands of radio stations to their users. I got jobs referring to Dirble on my Resume.

Services like Rune Audio was using Dirble. You could buy a php code that was more or less a clone of Dirble, using Dirble's api. And you could use Iphone apps like soundseeder that was using Dirble's api for internet radio stations. And many more.

Now Dirble haven't been up since summer 2019. I will now tell you why.

I started getting tired of Dirble, it was a cool technical solution I was proud of but it have been costing a lot privately and I wanted to spend less time on it and spend more time on my future projects. I also felt stressed to losing revenue and some months here and there pay from my own pocket to make Dirble Survive. I was more or less tired of making excuses to my then fiancee, now wife, where all the money disappeared.

Then I got a mail of a young guy in USA wanting to buy Dirble for a okay sum, based on that the Dirble was going plus-minus 0. I accepted and prepared a 4 month long transfer of the project with some hiccups on the way. 

I didn't announce this as we thought of the new owner should announce it together with me.

The transfer was done at around February 2019. I saw Dirble up and running and was waiting for the announcement. Nothing happened. Thought the new owner was busy and let it go, it is his property now so I guess it is fine.

Then in summer Dirble was down and I felt pretty sad. I thought it would flourish now with someone with more money and emotion to this service that I had.

Dirble has been down since then.

I am sorry for every platform, app using Dirble that now have to go to someone else that is most likely worse than Dirble to handle their internet radio.

I am also  sorry for the end users, the people that used with or without knowing they was using Dirble. 

I am also missing those developers trying to steal all the data on Dirble and I had to send out angry emails. That was stressful but in retrospect, I do miss that.

What I am trying to say is that I wish it could gone better and I hope everyone can accept my apologies. This should have gone smoother and more transparent.

My learning is to be more transparent but also with my future projects being clear why people have to pay for the service, so I can continue on it and maybe make a career and live on the project.

And once, again, sorry.
Foundational JavaScript Concepts Through Short Tutorial Videos
Tags: javascript, webdev, tutorials, beginners
Published: 2020-04-14 11:55:31

---
title: Foundational JavaScript Concepts Through Short Tutorial Videos
published: true
description: Learn foundational javascript concepts through short tutorial vides!
tags: javascript, webdev, tutorials, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/rvq0svfvd5puifentv1j.jpg
---

I started making short tutorial videos to learn foundational JavaScript concepts! The first five are listed below. I would love to know what other concepts you might think I should include!

# Callbacks, Promises, and Async-Await in JavaScript

JavaScript touts asynchronous programming as a feature. In this video, we explore callbacks, promises, and async-await to handle async programming.

{% youtube QDsyvBzfiZo %}

# First Class Functions in JavaScript

JavaScript has first-class functions. What does this mean and why is it important?

{% youtube 4UeWzn4jzwM %}

# An Introduction to Test-Driven Development in JavaScript

In this video, we write some JavaScript code the TDD way.

{% youtube SbKPgaRZsxA %}

# An Introduction to Pure Functions in JavaScript

Pure function is one of those terms that might be intimidating at first, but the concept is actually quite simple. In this video, we define what pure functions are and why they're good.

{% youtube vpOCbjWloEg %}

# An Introduction to Memoization in JavaScript

Memoization is an optimization technique used in many programming languages to reduce the number of redundant, expensive function calls.

{% youtube 6tbUPqnu-Ws %}
30-Day LeetCoding Challenge: Diameter of Binary Tree
Tags: python, leetcode, coding, algorithms
Published: 2020-04-14 11:53:28

---
title: 30-Day LeetCoding Challenge: Diameter of Binary Tree
published: true
description: the 11th-day problem of 30-Day LeetCoding Challenge
tags: python,leetcode,coding,algorithms
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/xt8a93i1962xl0onv9i2.jpg
---
### [The problem](https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/529/week-2/3293/)

******

## Solution:

It asks us to find a binary tree diameter, it also explains to us that is the diameter of a binary tree is **the length of the longest path between any two nodes in a tree.**

It is also indicated that doesn't matter if the path passes by the root or not.


So, we need to calculate the depth of each node in the tree and then find the longest path between the nodes.

First the depth of node can be found by `node.depth = max(node.left.depth, node.right.depth) + 1`.

Also, the path always will be the depth of the left subtree + the depth of the right subtree, so on each node, we need to choose the maximum value that takes us to the final answer so our answer will be: `diameter = max(diameter, left_depth + right_depth)`.

So, how we can calculate that if you look to the illustration above we see that we need to go deep to the tree to get one node depth which means we need to use `depth-first search DFS`.

We use DFS to find the left subtree depth then find the right subtree depth and later choose between them.


* **Pseudocode:**

* `diameterOfBinaryTree(root)`
```
1. define our answer
2. call find_depth_helper(root) with the root to find the longest path.
3. return our answer
```

* `find_depth_helper(node)`
```
1. if the node is None return 0
2. find_depth_helper(node.left) --> left_depth
3. find_depth_helper(node.right) --> right_depth
4. answer = max(answer, left_depth + right_depth)
5. return the current node depth max(left_depth, right_depth) + 1
```

* **Complexity:**

* Time Complexity: it is so clear that we go over all our nodes so our time will be **O(n)** where **n** is the number of nodes in the tree.

* Space Complexity: we use recursion stack as we do recursion calls and this stack will be equal to the number of nodes we have so our overall space will be **O(n)**.

* **[Solution in python](https://github.com/AhmedRaafat14/Leetcode-problems/blob/master/30-Day-LeetCoding-Challenge/diameter-of-binary-tree/Solution.py)**
Meus vários blogs
Published: 2020-04-14 11:44:28

O milagre de uma googlada no seu próprio nome faz, acabei encontrando três blogs que criei e abandonei na minha vida de programador, resolvi que vou reblogar esses conteúdos aqui, primeiro pra relembrar algumas das coisas que ja criei e centralizar esse conteúdo num único lugar.

Seguem links originais em ordem de antiguidade:
<https://gardelsi.blogspot.com/>
<https://monodel.blogspot.com/>
<https://gardelsouza.wordpress.com/>
Windows -> Docker -> Shared Volume/Folder
Tags: docker, tutorial, beginners, todayilearned
Published: 2020-04-14 11:15:41

Almost a year ago I had issues setting up the shared volume on Windows machine, tried a few tutorials I found online but that did not help... 
So I decided to share my experience.

First of all, we need Docker, [here](https://docs.docker.com/docker-for-windows/install/) are installation instructions.
You can verify your installation by running this command:

`docker -v`

and output should be similar to this:

`Docker version 18.09.2, build 6247962` - OK, so we are ready to go.

Why do we need a shared volume? 

We want to have a shared folder because then we can use our favorite code editor on our Windows machine and all changes will be automatically synced with our Docker container.

Let's enable the share drive option.
Open up Docker Desktop and click on Shared Drives:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9f8op1fwv1vqiv6pyb76.png)

On the right side select drive, you want to share, in my case, it is drive C, and finally, click on the Apply button.

Now, we can test this up, open up CMD and type this command:

`docker run -it -v c:/docker:/docker alpine sh`

please note that before running this command, for this purpose, I created a docker folder on my C drive. 
The most important part of the command above is `-v c:/docker:/docker` which is directory mapping, `c:/docker` is a folder on the host machine, Windows, `:/docker` is part regarding the container, you can name directory the way you want, a directory will be created automatically for you.

After the command is executed we will be in our Docker container:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0r71i4usnssolklxkd95.png)

Now we can see what do we have in this container by running:

`ls -la`

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8iqhv2gl58whjiz880um.png)

so the docker directory is created for us. Now we can cd into it and create a new file to test whether syncing is working type:

`cd docker && touch testfile1`

as a result, we have a file created:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9erqgjcn0v6i1go9kzlp.png)

now we can check if folder on Windows is up to date:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k62u2vme35avg00on227.png)

Great! It is working.

Just to double-check, create one more file but this time on Windows:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bpcifn0cuof4bfmfcpax.png)

now, check container:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e447mnfkglau6ol0056j.png)

It is working, nice!

This is all you need to do in order to utilize the sharing folder option between Windows as a host and a Docker container.

Thank you for reading!
CSS - how to place a dropdown on top of a dialog ?
Tags: help
Published: 2020-04-14 11:03:14

Hi,
I am quite new in CSS, and I am building an Angular application, on which I have a dialog popup for creating a Quiz. Inside that dialog, I have a form for providing the Quiz details,
One of these details is the list of the users to assign the Quiz to:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yfp3id30xroe9iw0ku9j.PNG)

In order to do this, I am using [ng-bootstrap](https://ng-bootstrap.github.io/#/components/dropdown/examples)

```
<div id="user-selection-container" ngbDropdown>
	<button class="btn btn-outline-primary" ngbDropdownToggle>{{ getUserSelectionButtonText() }}</button>
	<div id="user-selection-dropdown" ngbDropdownMenu>
		<app-users-chooser (selectedUsersChanged)="updateSelectedUsers($event)"></app-users-chooser>
	</div>
</div>
```
The "app-users-chooser" is a component that displays the list of users to choose from.

The issue is, when I open this drop-down, it appears "inside" the dialog:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/an0dajtuxd3ccw8r1qfz.PNG)

How can I make this drop-down to appear in front of everything?
I tried to change the z-index, but it did not help.
And maybe there is a better way to achieve this (instead of ng-bootstrap elements)?

I would be glad for any help\suggestions.
Send messages just by a POST request
Tags: twiliohackathon, node, heroku, twilio
Published: 2020-04-14 10:43:58

---
title: Send messages just by a POST request
published: true
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/dpmwtsyg0gjo6lpdhpvy.png
description: 
tags: twiliohackathon , nodejs , heroku , twilio
---

# msgco

A customizable and extensible messaging system.

# Use Case

Suppose you have a critical task running on your server, and you want to be notified when it completes or there is an error. You just have to make a POST request with the below specified payload and a message will be sent to the numbers you specify as parameter and text you specify as parameter with the POST request.

You don't need to signup on any messaging service, don't have to setup anything, just a simple POST request.

# Application flow

1. Register for the API. (not implemented)
2. Send POST request with numbers Array, and message body.
3. msgco service sends SMS to all the numbers provided.

# API Endpoint

https://msgco.herokuapp.com/critical/api

# Expected Payload for POST request at endpoint

{to : "number, number", body: "message body"}

# How to Run it ?

1. git clone git@github.com:ashishkumarsinghh/msgco.git
2. cd msgco
3. yarn or npm install
4. yarn start or npm start

#Github Repo
https://github.com/ashishkumarsinghh/msgco

# Limitations

- Currently because of Twilio Trial account the messages can be sent only to my number as it is verified.
- If you want to send msgs, you have to set the following parameters in Zeit/Heroku/Local production environment.
  - TWILIO_SID (you can get it from Twilio Console)
  - TWILIO_TOKEN(you can get it from Twilio Console)
  - TWILIO_NUM(you can get it from Twilio Console)
  - MYNUM(This is your verified number with Twilio)
CSRF_TOKEN Erro
Tags: django, python
Published: 2020-04-14 10:35:30

I am facing issue with {% csrf_token %}. I have already taken in my HTML file. But it gives error 403 Forbidden. This is my code of HTML file.



<h1>{{ error }}</h1>


<form method="post">{% csrf_token %}

    {{ form.as_p }}

    <br>
    <input type="submit"name="submit" value="Create User">

</form>
Clean Code Principles - Function
Tags: javascript, python, java, ruby
Published: 2020-04-14 10:33:17

I am reading a book Clean Code by Robert C. Martin and It is amazing so far. some principles he made need to be highlighted.

I am thinking of sharing other principles too as I go ahead in reading. because it will help me and you to learn and implement.

In this post, i covered **clean code principles for functions**.

1
> Function should do one thing. They should do it well. They should do it only.

2
> If a function does only those steps that are one level below the stated name of the function, then the function is doing one thing.

3
> The smaller and more focus a function is, the easier it is to choose a descriptive name.

4
> Another way to know that a function is doing more than "one thing" is if you can extract another function from it with a name that is not merely a restatement of its implementation.

5
> A long descriptive name is better than a long descriptive comment.

6
> The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided where possible. More than three (polyadic) requires very special justification-- and they shouldn't be used anyway.

7
> Function should either do something or answer something, but not both. either your function should change the state of an object, or it should return some information about that object. doing both often leads to confusion.

### Happy coding.

This post first published on [codebond.co](https://codebond.co/@codebond.cb/clean-code-principles-function)
Do this 1 thing to have more productive meetings
Tags: productivity, teamwork, engineeringmonday
Published: 2020-04-14 10:29:49

---
title: Do this 1 thing to have more productive meetings
published: true
description: A simple template to keep your team focused and productive during meetings
tags: productivity, teamwork, engineeringmonday
---

Once a week we have a development department meet where we discuss many topics from our day-to-day work and plans for the future.

To be as productive as possible, we have a **record template** for each meet. This record template consists of:

1. ATTENDEES
2. FIXED TOPICS - topics we go through every week
3. NEW TOPICS - everyone brings topics for the group discussion
4. DISCUSSION - log of everything we discussed
5. ACTION ITEMS - tasks on specific things for specific developer

❗Make sure your Fixed topics list contains "Last week record action items review" where you all review the previous Action items.

You can add and remove stuff from fixed topics and experiment with new things you want to achieve or go through on weekly basis.

We use *Paper* for this template, you can check it out and create your own productivity booster like [ours](https://paper.dropbox.com/published/Dev-Weekly-Meet-2020-mm-dd--AxEhw1TkbXFHmA6bNjOObozFBg-FOFS1zr1kkOgYwdqzEfRk6S) .

Here's an example list of our Fixed Topics:
    - Last week record action items review
    - Code metrics – our internal system of gamification
    - Education topic for this week
    - Blog posts we create (internal and external)
    - Shame my code – chance to show your current code and ask for advice
    - Employer branding stuff – Things we can share with the outer world

Hope it helps!
OpenSource Contribution - Live Coding
Tags: javascript, opensource, hacktoberfest
Published: 2020-04-14 10:19:28

---
title: OpenSource Contribution - Live Coding
published: true
description: 
tags: javascript, opensource, hacktoberfest
---

## How to Contribute to Open Source?

1. Find an opensource project that you use every day
2. Find faults in existing functionality 
3. Raise an issue in their Github repo
4. Offer the implement the feature
5. Read code
6. Implement the feature
7. Raise a PR
8. Get it reviewed and take it to merging

{% youtube 2T0QLbQkXqw %}
How to debug a tfx pipeline in vscode
Tags: airflow, tfx, debug, vscode
Published: 2020-04-14 10:11:01

  In this post, I would like to showcase how one can use the vscode built-in debugger to debug tfx pipelines orchestrated by airflow. I will base this guide on the official Chicago taxi example which can be found [here](https://www.tensorflow.org/tfx/tutorials/tfx/airflow_workshop).

  According to the example, you are supposed to start an airflow webserver as well as an airflow scheduler. From the webserver UI, you are able to trigger your DAGs and see if they are successful.

  If you want to use the debugger built-in vscode you have to make one small modification. The problem is that you are not able to start a DAG run from the IDE. You have to start an airflow scheduler process, trigger a DAG run through the webserver UI or the CLI and then the scheduler will actually execute the DAG run. As a result, you cannot start a DAG run by launching the debugger in current file mode.

  For the above reasons you have to use the ptvsd python module and launch the debugger in remote attach mode. Here is a step by step guide on how to do this:

- Install the ptvsd module by running 
```
pip install ptvsd
```
- Insert the following at the line where you would like to start debugging
``` 
  import ptvsd
  ptvsd.enable_attach(address=('localhost', 5678), redirect_output=True)
  ptvsd.wait_for_attach()
```
- In the debug tab inside vscode select add configuration from the drop down menu. Then select python and finally select remote attach. This will create a launch.json file with the debugger configuration. Don't start the debugger yet.
- Trigger a DAG run. When the execution reaches the wait for attach statement, launch the debugger. You should be able to use all the debugger features as usual.

It should be noted that if you wish to add breakpoints to your code via the vscode UI, they should be added to the actual file that the airflow scheduler will execute. If for example, you copy the DAG definition file to a specific folder that airflow checks, you should open that file in vscode and add any breakpoints there.
10 TYPO3 Things to Explore During Corona-Lockdown!
Published: 2020-04-14 10:10:32


These days, COVID19 is a tough situation to face. But if you’re stuck at home right now, then why not make the most of the time by learning, contributing and developing something productive for oneself and for the community? There are plenty of options here to give you some inspiration in these difficult times.
So let’s get started…

1. T3 Skills: Read, Learn and Explore TYPO3
2. T3 OpenSource Contribution: It’s time to give back to the Community
3. T3 Performance: Improve the speed-up of your TYPO3 website
4. T3 SEO: Optimize your TYPO3 website
5. T3 Blog: Start your own TYPO3 blog
6. T3 Video: Start your own TYPO3 video channel
7. T3 Social: Increase your TYPO3 Network
8. T3 Language: Learn and Improve Your English
9. T3 Extensions: Download and Share Your TYPO3 Extensions
10. T3Terminal: Explore the TYPO3 Marketplace Platform

Read the complete blog at — https://t3terminal.com/blog/10-typo3-things-to-explore-during-corona-lockdown/
Slow network simulation using Chrome devtool
Tags: webdev, testing, developers, beginners
Published: 2020-04-14 09:59:18


Chrome devtool team are developing more and more features to make our development activities easier. One of these interesting features is simulating network speed. you can do this with **five** simple steps only, lets see this in a practical way:

1. Press `Command+Option+I` (Mac) or `Control+Shift+I` (windows/linux) to open chrome devtool.

2.  Navigate to network tab.
![Network tab](https://dev-to-uploads.s3.amazonaws.com/i/vy7vv58ajiij9w4wjsbw.png)

3.  A small dropdown list will appear with default value **online**. Here you can change the network to another option like **slow 3G**
![Network tab options](https://dev-to-uploads.s3.amazonaws.com/i/vxh4mbghirxlh705rtxi.png)

4.  Open [dev.to](https://dev.to/)

5. Reload the page and see the magic


Also you can create your own network settings, just click on custom option and type your download/ upload/ latency values.
![custom network profiles](https://dev-to-uploads.s3.amazonaws.com/i/j0rztu2oaj8cpzpw4efn.png)

Here is an offline example for [dev.to](https://dev.to/) using offline preset option :smile:
![offline](https://dev-to-uploads.s3.amazonaws.com/i/6ib5803imqq8kixsettz.png)


Thanks for reading and happy hack week :v:.
So Many Possibilities to Pursue
Tags: devjournal, twiliohackathon, codenewbie, womenintech
Published: 2020-04-14 09:57:04

_This post was originally published on April 14, 2020 on [my blog](https://alexlsalt.github.io/blog)._

I did a lot of CSS grid practice yesterday and it is really just amazing stuff. I'm surprised it took me this long to jump on the bandwagon.

But seriously - mobile responsiveness with grid is amazing. I *cannot* wait to continue implementing it into the UIs of the apps I build.

I got version one of the project I'm planning on submitting for the DEV x Twilio hackathon. Submissions are due on April 30, so I have about 16 days left to learn how to add a backend to store user data and registrations! Fun stuff, I'm really excited about it.

I can't wait to share more about the project, too! I'm keeping it a bit under wraps for now because I want to release it all at once. Considering also starting to record myself with my coding days (using Loom?) and sharing those videos.

So, so, so many possibilities to pursue.