teleren/devto huggingface dataset:
Make your own docker command!
Tags: docker, bash
Published: 2020-03-05 20:40:49

I saw this post about a custom cli app to make it just a little nicer to quickly shell in to a local docker container:


{% post https://dev.to/pobb/docket-connect-to-your-docker-s-container-easily-10gc %}

And I thought, what if instead of a brand new command, it was part of the docker cli? It's not well advertised, but you can! So I installed it as a custom docker command. [Official docs here.][1]

There are a couple rules.

1. Where does the script go? I wanted to run `docker goto`. The easiest choice for me was `~/.docker/cli-plugins/docker-goto`. Whatever subcommand name you want, just prefix it with "docker-"

2. You must have a subcommand called "docker-cli-plugin-metadata". When I run `docker goto docker-cli-plugin-metadata`, it has to output specific json. This block is enough:

    ```bash
    if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
    cat << HERE
    {
      "SchemaVersion": "0.1.0",
      "Vendor": "example.com",
    }
    HERE
    exit
    fi
    ```

3. Make it executable: `chmod +x ~/.docker/cli-plugins/docker-goto`

Now you can make it do whatever you want! [Full code in this gist.][2]


[0]: https://dev.to/pobb/docket-connect-to-your-docker-s-container-easily-10gc
[1]: https://docs.docker.com/engine/extend/cli_plugins/
[2]: https://gist.github.com/djeikyb/b88bf10acba88797f72eabe9c7c414fb
31 Days of March Media Madness
Tags: media, challenge, productivity, sprint
Published: 2020-03-05 20:35:30



Hi, I’m Prosper Otemuyiwa popularly known as [@unicodeveloper](https://github.com/unicodeveloper). I’m a web optimization addict and a sucker for wholesome hacking tricks.

Late last year, I created an album that won the hearts and minds of readers, technical gurus, media aficionados, software developers, and instagram-filter artists across the world. It had 25 hit songs. As a genius recognized solely by my Mum and Dad, I created these hits, day after day, consecutively.

You didn’t have a chance to listen to it? Here you go:

[**25 Days Of Media Magic - The Ambitious Sprint**](https://dev.to/unicodeveloper/25-days-of-media-magic-the-ambitious-sprint-1m2m)

Sequel to this is what I’m currently working on, known as a *collabo*, and titled: [_31 days of March Media Madness_](https://twitter.com/search?q=%23MarchMediaMadness&src=typeahead_click).

It’s a mad challenge with a simple principle that questions, stretches & improves your knowledge of media asset manipulation & transformation.

It goes thus:

1. Everyday this month (March currently), I’ll post an image on Twitter that I applied one or more transformation parameters to. I’ll also provide one or more URLs with the base image that I started from. It’s also for you to kickstart the process that got me to the derived image.

1. You take a stab at modifying the URL by guessing the transformations I used to arrive at the final image I posted.

1. Once you have guessed your URL after trying it yourself, you can go ahead and submit your guess here — [https://cloudinary.rocks/MarchMediaMadness](https://cloudinary.rocks/MarchMediaMadness) for a chance to win a daily prize #MarchMediaMadness

### **Day 1 Challenge:**

{% twitter 1234082303602823173 %}

### **Day 2 Challenge:**

{% twitter 1234433651225628672 %}

### **Day 3 Challenge:**

{% twitter 1234932152493539328 %}

### **Day 4 Challenge:**

{% twitter 1235246957834252289 %}

### **Day 5 Challenge:**

{% twitter 1235616186152284161 %}


Tell your family, and friends. Asides improving your muscle memory of tons of media tricks to use in your startup products, side projects, hackathon & gigs, you’ll also get a prize if you win any of the challenges.


> # *Let's do this!*
Curry And Composition Function in JavaScript
Tags: showdev, javascript, slimcoder
Published: 2020-03-05 20:34:24

---

firstPublishedAt: 1583438596874
latestPublishedAt: 1583439905689
published: true
slug: curry-and-composition-function-in-javascript
title: Curry And Composition Function in JavaScript
cover_image: https://cdn-images-1.medium.com/max/1000/1*NLvMCMdFvCwDRsxX3hTsBA.png
tags: showdev,JavaScript,slimcoder

---
---

In this article i will discuss about:

1. Higher Order Function

1. Curry Function

1. Composite Function

# 1) Higher Order Function

Higher-order functions are regular functions that do one or both of the following:

1. Takes one or many functions as arguments

2. Returns a function

Let’s look at simple example.

> const c = b => b ;

> add(a,b) => a+b; // here b is a function

> add(3,c(3)) ;

# 2) Function Curry

A curried function is a function which takes multiple parameters one at a time, by taking the first argument, and returning a series of functions which each take the next argument until all the parameters have been fixed, and the function application can complete, at which point, the resulting value is returned.

> const add = a => b => a + b;

> const result = add(2)(3); // 5

# 3) Composite Function

Curried functions are particularly useful in the context of function composition.

In terms of algebra :

> g: a -> b
> f: b -> c

Suppose :

> h: a -> c
> h = f . g = f(g(x))

> // Algebra definition, borrowing the `.` composition operator

In JavaScript :

> const g = n => n + 1;

> const f = n => n \* 2;

> const h = x => f(g(x));

> h(2); // 6
Go environment
Tags: go, beginners
Published: 2020-03-05 20:18:14

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Go supports the following systems:

* Linux
* FreeBSD
* Mac OS X (also known as Darwin)
* Windows

Download installation package is: <https://golang.org/dl/>.

Each system corresponding to the package name:

Operating system | package name
--- | ---
Windows | go1.4.windows-amd64.msi
Linux | go1.4.linux-amd64.tar.gz
Mac | go1.4.darwin-amd64-osx10.8.pkg
FreeBSD | go1.4.freebsd-amd64.tar.gz

## UNIX / Linux / Mac OS X, and FreeBSD installation

The following describes the use of the source code in the UNIX / Linux / Mac OS X, and FreeBSD system installation method:

1. Download Source Package: go1.4.linux-amd64.tar.gz.

2, unzip the downloaded source package to `/usr/` local directory.
```
tar -C /usr/ local -xzf go1.4.linux-amd64.tar.gz
```

3, add `/usr/` local / go / bin directory to the PATH environment variable:
```    
export PATH = $PATH:/usr/local/go/bin
```

**Note:** You can use the MAC system .pkg the end of the installation package by double-clicking to complete the installation, the installation directory `/usr/local/go/down`.

## Windows system installation

Under Windows you can use .msi suffix (download list can be found in the file, such as go1.4.2.windows-amd64.msi) installation package to install.

By default, the .msi files will be installed in the c: \ directory Go. You can c: \ Go \ bin directory to the PATH environment variable. After adding a command window you need to restart to take effect.

### installation testing

Create a working directory C: \> Go_WorkSpace.

File name: test.go, code is as follows:
```go
    package main
    
    import "fmt"
    
    func main () {
       fmt.Println ( "Hello, World!")
    }
```
Using the go command code above output results are as follows:
```
    C:\Go_WorkSpace> go run test.go
    
    Hello, World!
```

**Related links:**
* <a href="https://golangr.com/about-go/">About Go</a>
* <a href="https://golang.org/">Golang website</a>
Hanadle Flask requests by versions
Tags: python, flask
Published: 2020-03-05 19:52:10

Just wrote a python package
In order to handle flask endpoints by versions.
Now its easy to register multiple view functions and handle your incoming requests by versions!
I hope it will be useful for you guys.
Let me know what do you think :)

You can find it on GitHub
https://github.com/itay-bardugo/flask_version
Python tools
Tags: python, beginners
Published: 2020-03-05 19:47:04


In this article we'll discuss some python tools, these will make your development easier. Namely:

* the python package manager pip
* virtual environment
* remote ssh.
 

## Pip for package management

Python has many available packages or modules. These are existing code bases you can use to accelerate development. This is similar to libraries in C/C++. 

To install module you need pip. To install pip, see <a href="https://pythonbasics.org/how-to-use-pip-and-pypi/">this article</a>.


For module installation, you can specify a version number

```bash
(sudo) pip install Django == 1.6.8
```

Upgrade package

```bash
(sudo) pip install bpython --upgrade
```

Install multiple packages
```bash
(sudo) pip install BeautifulSoup4 fabric virtualenv
```

Installation from the text, the text for the package name, one per line, you can specify a version number

```bash
(sudo) pip install -r requirements.txt
```

Delete a module
```bash
(sudo) pip uninstall xlrd
```

Export the currently installed package

```bash
pip freeze> requirements.txt
```

## Virtualenv independent Python environmental management

virtualenv is a Python package to create a separate environment. Using <a href="https://pythonbasics.org/virtualenv/">virtualenv</a> you won't have any module conflicts (as you may get when installing with sudo).

```bash
    # Installation:
    (sudo) pip install virtualenv virtualenvwrapper
    
    # .Bash_profile or modify .zshrc (if you use the words zsh), add the following statement
    export WORKON_HOME = $ HOME/.virtualenvs
    export PROJECT_HOME = $ HOME/workspace
    source /usr/local/bin/virtualenvwrapper.sh
```

* `mkvirtualenv ENV`: create a running environment ENV
* `rmvirtualenv ENV`: Delete operating environment ENV
* `mkproject mic`: Creating runtime environment mic and mic project
* `mktmpenv`: Create a temporary runtime environment
* `workon bsp`: bsp work in the operating environment
* `lsvirtualenv`: Lists the available operating environment
* `lssitepackages`: Lists the current environment installed the package

Environment created is an independent, non-interfering, without the need to use sudo permissions pip to manage packages.

Documentation: <https://virtualenvwrapper.readthedocs.org/en/latest/>

## Remote SSH

fabric: Fabric is a high level Python (2.7, 3.4+) library designed to execute shell commands remotely over SSH, yielding useful Python objects in return.

```python
from fabric.api import *
    
# server list
env.hosts = [ 'user@server1', 'user2@server2']

def ls_home():
    with cd('/home/username/'):
        run('ls')
    
```

Official website: <https://www.fabfile.org/>
Documentation: <https://docs.fabfile.org/>
Spring Boot Quick Start: Spring Boot Tutorial for Beginners
Tags: java, spring, springboot, rest
Published: 2020-03-05 19:45:39

---
title: Spring Boot Quick Start: Spring Boot Tutorial for Beginners
published: true
description: In this tutorial, I will walk you through creating your first Spring Boot REST Application.
tags: java, spring, springboot, rest
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/a9ymk75iscj72qr22z54.png
---

In this Spring Boot quick start, you are going to learn how to create a simple Spring Framework application using Spring Boot. We will discuss different IDE & Text editor options, create the new Spring Boot application using the Spring Initializr and then import it into IntelliJ IDEA. This Spring Boot Tutorial for Beginners will follow a new quick start guide on the Spring.io website.

{% youtube df7Dso9q700 %}

When you have completed this tutorial you should understand: 
  ✅ Understand what Spring Boot is and what it gives us
  ✅ Create a new project using the Spring Initializr
  ✅ Import the project into your IDE of choice
  ✅ Create a REST controller in Spring Boot
  ✅ Use the @GetMapping annotation from the Spring Framework
  ✅Running a Spring Boot Application

🔗Resources & Links mentioned in this video:

Spring Boot Quick Start: https://spring.io/quickstart
Spring Boot in Visual Studio Code: https://youtu.be/5mpHejytgFE
Lights Puzzle made with Vue
Tags: showdev, vue
Published: 2020-03-05 19:26:15

I built this project a while ago, but I wanted to add more levels and clean-up the code before showing it off.

The game board can be navigated using arrow keys.
If there's anything I can improve on in terms of accessibility please let me know and I'll do my best to fix it.

Thanks for reading. :smile:

- [Repo](https://github.com/Dana94/lights-puzzle)
- [Live](https://kind-kilby-d6c11a.netlify.com/)

See if you can beat my scores:

**Level 1**: 5 moves

**Level 2**: 25 moves

**Level 3**: Still haven't had a chance to solve. :sweat_smile:
I Wrote the Same App in Pascal and AlpineJS
Tags: javascript, alpinejs, pascal, webdev
Published: 2020-03-05 19:26:00

I wrote the same web app in Pascal and AlpineJS and here is what I learned: [article](https://medium.com/javascript-in-plain-english/i-wrote-the-same-app-in-pascal-and-alpinejs-305844b68930)
Yup validation - one field required but not both at the same time
Tags: yup, form, validation, javascript
Published: 2020-03-05 16:53:40

---
title: Yup validation - one field required but not both at the same time
published: true
date: 2020-03-05 16:16:03 UTC
tags: yup,form,validation,javascript
canonical_url: https://krzysztofzuraw.com/blog/2020/yup-validation-two-fields
---

Recently I was working with [yup](https://github.com/jquense/yup) for form validation andI faced the following problem:

I have two fields inside my form. I want the user to provide one of them but not both at the same time. I’ve played a little bit with different ideas to get solution below. It is using [test](https://github.com/jquense/yup#mixedtestname-string-message-string--function-test-function-schema) and [when](https://github.com/jquense/yup#mixedwhenkeys-string--arraystring-builder-object--value-schema-schema-schema) functions from yup:

```tsx
import { object, string } from 'yup';

const schema = object().shape(
  {
    userName: string()
      .test(
        'notBothAtTheSameTime', // test name
        'You cannot pass user name at the same time as user email', // validation message to the user
        // it has to be function definition to use `this`
        function(userName) {
          const { userEmail } = this.parent;
          if (userEmail && userName) {
            return false; // when user enters both userEmail & userName do not validate form
          }
          return true;
        }
      )
      .when(['userEmail'], {
        is: userEmail => !userEmail,
        then: string().required('User name is required'),
      }),
    userEmail: string()
      .test(
        'notBothAtTheSameTime',
        'You cannot pass user email at the same time as user name',
        function(userEmail) {
          const { userName } = this.parent;
          if (userName && userEmail) {
            return false;
          }
          return true;
        }
      )
      .when(['userName'], {
        is: userName => !userName,
        then: string().required('User email is required'),
     email
  [['userName', 'userEmail']] // important to add
);
```

If you want you can extract it to its own function via [addMethod](https://github.com/jquense/yup#yupaddmethodschematype-schema-name-string-method--schema-void). 

That’s all 🎉. Now user should get and error when they provide both `userName` & `userEmail`.
Charts for Charity: Pay What You Want for JSCharting with 100% of proceeds donated!
Tags: javascript, webdev
Published: 2020-03-05 18:28:04


*TLDR: For a limited time the JSCharting 8 in 1 bundle is being licensed for <a href="https://jscharting.com/store/pay-what-you-want/">whatever you want to pay</a>, with all proceeds being donated to <a href="https://www.ryanswell.ca/fundraising/pwyw-campaign/">Ryan’s Well Foundation.</a>*

Did you know that over 1 billion people don't have access to safe drinking water and 2.8 billion people lack adequate sanitation? The contaminated surface water below is depended on by a community of over 1000 people.

<a href="https://jscharting.com/store/pay-what-you-want/">![Contaminated Water Source](https://dev-to-uploads.s3.amazonaws.com/i/raiz1y2ki1aft3ztduwt.JPG)</a>


At JSCharting we believe that all people should have access to safe, clean drinking water. Without accessible water, children and women are less likely to attend school because they need to travel long distances to collect water for their families. These long journeys also put them at risk of assault. The United Nations recognizes access to water and sanitation as a fundamental human right; however, many populations still lack access to basic drinking water:
<a href="https://jscharting.com/store/pay-what-you-want/">![Water Access Map](https://dev-to-uploads.s3.amazonaws.com/i/hrxwk0o6ui03csk2q67k.PNG)</a>

View an interactive JavaScript version of this <a href="https://jscharting.com/examples/chart-types/geographic-map/">map</a>.

To help those in need receive this basic human right, JSCharting has partnered with <a href="https://www.ryanswell.ca/fundraising/pwyw-campaign/">Ryan's Well Foundation</a> and, with your support, we can make a difference.

Purchase a JSCharting 8 in 1 bundle at the price you choose and all proceeds will be used to drill wells, improve sanitation, and fund education.

<a href="https://jscharting.com/store/pay-what-you-want/">![JSCharting Bundle](https://dev-to-uploads.s3.amazonaws.com/i/y44lg0k5eohnvhkkvk5x.png)</a>

In addition to donating all future proceeds from the PWYW campaign, JSCharting has also made a $20,000 donation to Ryan's Well Foundation.

<a href="https://jscharting.com/store/pay-what-you-want/">![Traveling long distances to collect water](https://dev-to-uploads.s3.amazonaws.com/i/3au7af5frxzelwtjnwzi.jpg)</a>

When you <a href="https://jscharting.com/store/pay-what-you-want/">Pay What You Want</a> for JSCharting today, you will help save lives tomorrow. A heartfelt thanks to the JavaScript developer community for your support and for making a positive difference in the world!
React Chatbot using MERN stack and Dialogflow
Tags: react, node, mongodb, chatbot
Published: 2020-03-05 18:16:11

Hi, 

I created an **React Chatbot** using **Reactjs, Nodejs, MongoDB** and **Dialogflow(NLP)**.

It is an interactive web application chatbot to interact with the users, who visiting your application. This chatbot is made with MERN stack using **Google's Machine Learning Dialogflow(NLP)**. Dialogflow uses **Natural Language Processing(NLP)** technique to make the bot understand the Human Language and to efficiently interact with users. I am ReactJs as the frontend and NodeJs as backend, which will interact between the Frontend and Dialogflow to get desired results.

Please check the complete code repository for the chatbot and Give a 🌟 in github, if you like it.

Github Respository - [https://github.com/jeyk333/React-Chatbot](https://github.com/jeyk333/React-Chatbot)

To play with it -> [https://vast-badlands-40215.herokuapp.com/](https://vast-badlands-40215.herokuapp.com/)

Things you can ask to it

1. Hi/Hello
2. where is pikachu
3. courses (It will list some dummy courses from the mongo db and will ask, if you need any personal training)
4. If you give Yes for the personal training, it will ask for your details.
5. You can enter the details, which will also stored in the database
6. You can also do some random chats

The UI may look bad, as i didn't put much effort in the ui for now. Its not completed. I am still improving the chatbot.
Community Hangout - 2020-03-07 - v4.0.5
Tags: hangout, community, hoa, phalcon4
Published: 2020-03-05 18:15:15

---
title: Community Hangout - 2020-03-07 - v4.0.5
published: true
date: 2020-03-05 17:56:14 UTC
tags: hangout,community,hoa,phalcon4
canonical_url: https://blog.phalcon.io/post/community-hangout-2020-03-07-v4-0-5 
---

We are having a live release hangout, releasing **Phalcon v4.0.5** this weekend!

Join us on Saturday the 07th of March 2020, at 12:00:00 EST (17:00:00 UTC), to talk about our progress, address concerns, chat while at the same time releasing v4.0.5

We will hold this virtual meeting on a live event in YouTube. The URL for the hangout is:

[https://youtu.be/-esfyJ3MiKg](https://youtu.be/-esfyJ3MiKg)

Topics to discuss:

- Introduction, welcome to all attendees
- Thank you to the whole community and contributors
- Status update since last hangout
- v4.0.5 live release
- Q/A

Looking forward to hearing from all of you and seeing you during the hangout.

* * *

Chat - Q&A

- [Discord Chat](https://phalcon.io/discord)
- [Forum](https://phalcon.link/forum)

Support

- [OpenCollective - Support Us](https://phalcon.io/fund)
- [Store - Merchandise](https://phalcon.io/store)

Social Media

- [Telegram](https://phalcon.io/telegram)
- [Gab](https://phalcon.io/gab)
- [MeWe](https://phalcon.io/mewe)
- [Parler](https://phalcon.io/parler)
- [Reddit](https://phalcon.io/reddit)
- [Facebook](https://phalcon.io/fb)
- [Twitter](https://phalcon.io/t)

Videos

- [BitChute](https://phalcon.io/bitchute)
- [Brighteon](https://brighteon.com/bitchute)
- [LBRY](https://phalcon.io/lbry)
- [YouTube](https://phalcon.io/youtube)

<3 Phalcon Team
Personality Swap - new problem based on Futurama episode
Tags: challenge, algorithms
Published: 2020-03-05 17:42:29

One of episodes of Futurama series (_Prisoner of Benda_) is about personality-swapping machine - it can exchange two people's bodies, but only once for each given pair.

This makes quite a problem about returning personalities to their bodies. You may test your algorithmic skills trying to solve it :)

[**Personality Swap @ CodeAbbey**](https://www.codeabbey.com/index/task_view/personality-swap)

![Prisoner of Benda](https://i.imgur.com/4D8PmUN.png)
Multiple carets in jetbrains/IntelliJ IDEs
Tags: ide
Published: 2020-03-05 17:40:28

---
title: Multiple carets in jetbrains/IntelliJ IDEs
published: true
description: 
tags: ide
---

## Add multiple carets

Press `alt` twice and move the cursor up and down while holding `alt` with the arrows to add more carets.

![Add multiple carets animation.](https://media.giphy.com/media/KDhtvwQCSr3YTwQdwF/giphy.gif)

## Select multiple occurrences of a word

Select a word and press `ctrl + g` and it will select the next occurrence of that word.

![Select multiple occurrences of a word animation.](https://media.giphy.com/media/SYixIDFStFqqe3L8cb/giphy.gif)