teleren/devto huggingface dataset:
LF Advice: VIM/TMUX Environment For Python
Tags: discuss, python, vim, help
Published: 2020-01-16 03:06:44

I have recently started the Computer Science section at Lambda School and we have started learning python! I'm so excited! Also, I've decided that this would be the perfect time to start that deep dive with VIM that I've been wanting to take. And surprisingly it's going a lot better than I expected so far!

Like the title said I'm using VIM and TMUX. Trying to get my .vimrc on point and just learning in general. I only have NERDTree as far as plugins go, I'd rather do everything I can in my .vimrc file and be as minimal with plugins as possible. I have the space bar set as my leader key and TMUX prefix is set to CTRL + A.

What are your favorite settings in your .tmux.conf and your .vimrc? What are the keybindings you have set that you feel are the most impactful for your workflow? What plugins can't you live without? If you could go back to when you first started to embark on your VIM/TMUX journey, what advice would you give yourself? What advice would you give me? I'd love to hear your thoughts in the comments below! Thanks in advance. :rocket:

Here are my config files below so you guys can see what I already have:

.tmux.conf
```
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# Start window numbering at 1
set -g base-index 1
```
.vimrc
```
set nocompatible
filetype off

call pathogen#infect()
call plug#begin('~/.vim/plugged')

Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }


call plug#end()

filetype plugin indent on

syntax enable
command! MakeTags !ctags -R .

" Set's leader key to SPACE
let mapleader = ' '

" Some basics
set number
set smartindent
set tabstop=8
set shiftwidth=4
set softtabstop=4
set expandtab
set path+=**
set wildmenu
set splitbelow
set splitright
set noswapfile

" Toggles NERDTree on and off
nnoremap <Leader>t :NERDTreeToggle<Enter>
" Saves file and runs python code from normal mode
nnoremap <Leader>i :w<CR>:!clear;python %<CR>
" Saves file and runs python code from insert mode
inoremap <C-i> <Esc>:w<CR>:!clear;python %<CR>

" HTML:5 Snippet
nnoremap html :-1read $HOME/.vim/snippets/HTML5_template.html<Enter>6j3wa

" deletes a pair of (), [], {}, or <>
nnoremap .dp ma%x`ax

" Gives you doubles
inoremap " ""<Left>
inoremap { {}<Left>
inoremap ( ()<Left>
inoremap [ []<Left>
inoremap < <><Left>

inoremap ii <Esc>
" CTRL + d backspaces and deletes from insert mode 
" (Mainly for deleting double quotes or brackets if I didn't mean it.)
inoremap <c-d> <Backspace><Delete>
" Thinking about making A LOT OF THESE!!!!
inoremap <h1 <h1></h1><Left><Left><Left><Left><Left>

" split screen navigations:
" ctrl + j = move to split screen below
nnoremap <C-J> <C-W><C-J>
" ctrl + k = move to split screen above
nnoremap <C-K> <C-W><C-K>
" ctrl + l = move to split screen right
nnoremap <C-L> <C-W><C-L>
" ctrl + h = move to split screen left
nnoremap <C-H> <C-W><C-H>

```
Stories of Form - Validation
Tags: finalform, react, code
Published: 2020-01-17 04:02:28

## Introduction

Validation is a compulsory feature for every input form. Basically, the validation of the user's input data should be instant feedback.

Instant feedback means right after the user finishing the input, the system should provide a response about the validity of data, or at least show to the user that the validation process is running. If the data is invalid, the response should provide enough information to help the user rectify the data.

Validation logic could be based on many factors. It depends on the system's requirements, type of data,... For example:

- Time to trigger the validation: when the user inputting, or when the user finishing the input.

- Validation method: synchronous (input's format, comparison,...), or asynchronous (duplication, existent,...)

- Validation data: by Field-level, or by Form-level.

- Time to feedback: when the user opens the form, or after the user touches a field.


## How does `Final-Form` do validation?

Firstly, `final-form` have 2 validation levels: Field-Level and Form-Level, by using `validate` attribute of `<Field>` and `<Form>` tags.
Especially, we can use both synchronous and asynchronous methods as a validation method. These methods should only care about the return result. At Field-Level, the return result should be a string which is the feedback's content in the invalid case, or `undefined` for the valid case. At Form-Level, the return result should be an object which has keys are the field's names and values are the feedback of fields. Or we can use a special key `FORM_ERROR` to set the feedback for whole form.



Tương tự như các thư viện khác, `final-form` cung cấp thông tin `meta` bao gồm các cờ thể hiện trạng thái của `Field` và `Form` nhằm hỗ trợ quyết định thời điểm thực hiện kiểm tra và thời điểm phản hồi. Các trạng thái thường dùng như:

- `pristine`: còn "trinh". chưa được người dùng truy cập (focus, input,...) tới.
- `dirty`: người dùng đã truy cập
- `touched`: người dùng đã focus vào
- `active`: người dùng đang focus
- `invalid`: đã thực hiện kiểm tra và không hợp lệ
- `valid`: đã kiểm tra và hợp lệ
- `validating`: đang kiểm tra


## Demo

## Field-Level synchronous validation

{% codesandbox form-stories-validation-nmb1l %}

Some notes:
- We can compose some simple validations. We can use a validation library like [`yup`](https://github.com/jquense/yup). Just keep in mind the format of the output.
- We can access other fields' value and field state inside the validation
- By default, validation is triggered on change


### Field-Level asynchronous validation

{% codesandbox form-stories-validation-async-nmb1l %}

Some notes:

- In async validation function, must use `resolve` in case of invalid data. `reject` is reserved for API's errors

- Currently, there is an issue related to `validating` flag which reported here [#713](https://github.com/final-form/react-final-form/issues/713)

### Kiểm tra toàn bộ form
Editing DNS records for ZEIT Now
Tags: javascript, devops, html, css
Published: 2020-01-16 09:14:37

ZEIT Now is awesome, but one of the features that's missing is a GUI interface to edit and configure DNS records. It's actually
not even clear this is possible in the dashboard, but luckily there's a set of commands you can use with the CLI.

First off, if you haven't already install and authenticated in the `now` cli, you'll want to do that:

```bash
npm install -g now && now # Will prompt to login
```

Once you're logged in, you can use the commands in the `now dns` namespace. 

## Adding Records

```bash
now dns add <domain> <name> <record type> <value> [mx_priority]
```

- `<domain>` is the address owned by the user and previously registered withzeit.world by using the commands now domain add zeit.rocks or now alias
- `<name>` is the subdomain that will be prefixed to `<domain>` (@ as a `<name>` refers to the domain without any prefix)
- `<record type>` contains one of the supported record types shown above
- `<value>` indicates the target of the record (like an IP address or a hostname)
- `[mx_priority]` sets the priority of a certain MX record and can therefore only be used in conjunction with this record type


# Examples

Here's a few examples of commands that might be helpful.

Add a record for a subdomain

      $ now dns add <DOMAIN> <SUBDOMAIN> <A | AAAA | ALIAS | CNAME | TXT>  <VALUE>
      $ now dns add zeit.rocks api A 198.51.100.100

Add a MX record (@ as a name refers to the domain)

      $ now dns add <DOMAIN> '@' MX <RECORD VALUE> <PRIORITY>
      $ now dns add domain.com '@' MX mx1.improvmx.com 10 

Add a SRV record

      $ now dns add <DOMAIN> <NAME> SRV <PRIORITY> <WEIGHT> <PORT> <TARGET>
      $ now dns add zeit.rocks '@' SRV 10 0 389 zeit.party

Remove a MX record

      $ now dns ls # Show the records, and copy the ID you wish to remove
      $ now dns rm rec_92bd1b1e4311ffd93e4a2cae # ID from previous step


## API

If you're building a tool that integrates directly with Zeit Now, you could also manage the DNS records directly through the
API. You can find the endpoint [documentation here](https://zeit.co/docs/api#get-domain-records).
IBM / Red Hat first $1B openshift contract
Tags: ibm, redhat, openshift, devops
Published: 2020-01-16 11:21:06

IBM / Red Hat have just sold their first $1B OpenShift based cloud contract

* [ibm-red-hat-openshift-buy-out-starts-to-pay-off](https://vizz8info.wordpress.com/2020/01/16/ibm-red-hat-openshift-buy-out-starts-to-pay-off/)

"Long Live IBM/RedHat Open Shift" @matteojoliveau

* https://dev.to/matteojoliveau/moving-to-openshift-apo
* https://dev.to/livioribeiro/my-journey-through-openshift-13f2
* https://dev.to/livioribeiro/going-further-on-openshift-4m80
Optional booleans?
Tags: javascript, typescript, discuss
Published: 2020-01-16 12:10:49

If you define APIs, you usually discuss names and types a lot. One of these discussions brought up that one of my colleagues' dislike of optional boolean properties - and there's also a good reason for it, because undefined and false are coerced to the same value, which can lead to confusion.

I personally value the developer experience of having sensible defaults whenever possible over the possible misunderstanding of `false` and `undefined`.

Any other advantages and disadvantages I have overlooked? Please discuss!
the ultimate (non macbook) dev desktop for under £500
Tags: desktop, ide, webdev
Published: 2020-01-16 12:26:22

i often (haha) get asked how i can be so productive without owning a macbook well heres the secret of my success

* ibm/lenovo thinkpad T4xx and X2xx refurbs (supplier of your choice)
* a 33" virtual wide screen using [symless](https://symless.com/synergy) software defined desktop (SDD)
* [virtualbox.org](virtualbox.org)
* a ms mouse
* always be cloning (ABC) (not coding)

![X220 next to T410 next to X220](https://ik.imagekit.io/0h2y0y2rw/IMG_20200116_115509_hdvHf-4Wd.jpg)

of course [DEV.TO](dev.to) is ALWAYS on the LHS and [npm lib](https://www.npmjs.com/) on the RHS with development and devops work done on virtualised [xubuntu gnu/linux](xubuntu.org) desktops and [oracle gnu/linux](oracle.com/linux) servers in the middle

full spec

* triple intel core i5
* 3 x 11" wide screen(s)
* 3 x 8G RAM
* 3 x 500G disk (doesnt even need to be SSD)

in case you havent come across it before [symless](https://symless.com/synergy) lets you have a single keyboard/mouse controling multiple other desktops (windows, macos or gnu/linux based) like a sort of software defined KVM (SDK) (:smile:)
What's your preferred Node.js testing setup?
Tags: javascript, node, testing, discuss
Published: 2020-01-16 16:13:46

I'm currently working on building a new Node.js application from the ground up at work. This is the first time I've done this for anything other than a personal side project, and I'd really like to do it right.

In pursuit of that goal, I want to introduce unit and integration tests early on in the process, but I don't have much (*read: any*) experience with unit tests in Node, so I'm not sure what all is out there. I've used [Jasmine](https://jasmine.github.io/) for AngularJS apps in the past, and while that was... rough, to say the least, I think that was more Angular's fault than Jasmine's, and I liked working with Jasmine overall. I've also heard good things about [Mocha](https://mochajs.org/), though I've never done more than a couple toy examples myself. And I guess there's this thing called [Jest](https://jestjs.io/) that has popped up recently as well?

Are these frameworks still applicable in the server-side world? Are there newer, better frameworks I should be aware of?

How about for testing database interactions? I'd like to set up a harness that will run our migration scripts to build a little SQLite database on the fly for testing, something like that; is that the best approach?

I'm relatively new to this kind of testing, and I know we have some very experienced DEVs here, so any advice would be very welcome!

I'd also be happy to read any other articles that have been written on related subjects, so feel free to drop links!

Thanks in advance! 🙏😁
User-friendly peer to peer file sharing as a simple web app - drop.lol
Tags: showdev, javascript, typescript, react
Published: 2020-01-16 16:31:24

I'm happy to launch this free file sharing tool: https://drop.lol

It's fully open source, licensed under BSD.

https://github.com/mat-sz/filedrop-web and https://github.com/mat-sz/filedrop-ws

## My motivation

I've created this because I was getting annoyed by having to log in to my e-mail account on computers I don't own just to download some attachments - I use a password manager and it gets really tiring (having to manually type a long password). I also didn't like the idea of having to upload files to third party services that could store them.

To resolve these issues I've created my own service that allows for easy WebRTC-based file transfers. In some cases the traffic may be relayed through my TURN server but WebRTC provides end-to-end encryption, so no contents can be seen.

## How does it work?

A WebSocket server is used to allow for WebRTC connections being created and to handle some transfer metadata to protect the user's privacy - no WebRTC peer connections are created until both parties agree to a file transfer.

The client side of the app uses React, TypeScript, Redux and Redux-Saga. For the backend I've used node.js and ws (no TypeScript there).
autoposted from github 239620
Tags: devto, autopost, github
Published: 2020-01-16 19:06:56

---
published: true
title: 'autoposted from github 239620'
cover_image: 'https://raw.githubusercontent.com/maxime1992/my-dev.to/master/blog-posts/manage-dev-to-blog-posts-with-continuous-deployment/assets/github-travis-dev-to.png'
description: 'autoposted from github 239000'
tags: devto, autopost, github
series:
canonical_url:
---

# Head 1

Hey, some text!

## Head 2

Hey some images !

![alt image text](https://ik.imagekit.io/0h2y0y2rw/Screenshot_2020-01-13_Welcome_to_Traffic_England_dtHMkHSlS.png)

![alt image text](https://ik.imagekit.io/0h2y0y2rw/Screenshot_2020-01-16_confs_review_-_pick_your_next_conf_with_ease_2isxV5wjy.png)

![alt image text](https://ik.imagekit.io/0h2y0y2rw/Screenshot_2020-01-09_OpenFlights_org_Flight_logging__mapping__stats_and_sharing_Brf0lx_LB.png)
From Accounting background to 1st Software Engineer project! 
Tags: ruby, productivity, motivation, career
Published: 2020-01-16 19:41:08


I remember the time when I was drafting a letter for my college application.  I enrolled in University of Maryland and studied in the Accounting major.  I landed in the years of experience where I successfully proved my capabilities and go beyond what others struggled with. As the time passed by, the technologies were changing to make people live earlier.


I always wondered who was that person that developed a product so I can thank that person for making my life better and easier.


When I enrolled at the Flatiron school, I had absolutely no knowledge of the coding at all.


I began my journey with my first CLI project about a mere week ago. At that point, I couldn't find a way to the starting point. I knew what are the requirements that need to be done. But I had no courage to get this project going yet.


At first , I needed to figure out how to build out the project structure. I had no idea how to build a gem.  There were plenty of resources available from Flatiron, but several problems required me to look outside the scope of what our school had to offer.

Moreover,  I committed my time by attending the office hours daily. I  reviewed several labs many times until I get comfortable with the whole concepts.


Not only my coach who had been very helpful, my classmates who have helped me more than I could help them.


Failure after failure for many hours of trying to figure out how to build the structure. Once I figured out how to build the gem file structure correctly, I would then need to understand the function of each piece of the gem. Then, figure out how each piece of the gem interacted with each other. At that point, I have not started writing any code yet.


Eventually I finally started to get the feeling back as soon as I typed "def" in the code. At that moment , I was moving forward on the project with the motivations.


My project is based on exploring who are the top companies hiring at this moment  My project will explore into the details such as the review, location,  name.


I successfully scraped that data from one of the known hiring site: monster.com. Then I poured it into the code. That was one of my greatest feeling ever .


Then I moved onto adding more codes so I can build a console that has an option to choose the various options from the menu. I made this system easier for users so they can browse and select what company they want to read more information about that.


I can't wait to make this project into an actual app along with beautiful UI design. If I'm lucky enough,  I want to make huge impact around the world for any user using my project. Who know, one day they will say "Thank You".



I look forward to building the next project and I look forward to gain more skills.

As you may have heard in the past , having more knowledge come with great responsibilities. I look forward to having the great responsibility. I look forward to making easier for the world.

I’ve come a long way, and I am proud of the creation I have made.
Github Education Pack for Students provides about $200k worth of tools and training for free!
Tags: todayilearned, opensource
Published: 2020-01-16 19:54:25

The [Github Education Pack for Students](https://education.github.com/benefits) offers so many perks such as free domains, prenium icons, programming lessons, interview prep and many other developer resources. Basically, students can get about $200k worth of tools and training for free!  😮😵 Wish I knew about this earlier.
what's the latest on InfluxDB cloud compared to grafana cloud?
Tags: influxdb, grafana
Published: 2020-01-16 22:51:01

Anyone here have experience with influxdb and end up using graphite and Prometheus with grafana (as they offer that as a service now)?

Looks like grafana cloud includes both of those stacka so curious about flexibility they offer in comparison to influxdb cloud.

I do like being able to backfill data so Prometheus doesn't do that natively tmk. Completely unfamiliar with Graphite
Do you know goormIDE?
Tags: ide, goormide, cloudide
Published: 2020-01-17 03:02:57

goormIDE: Powerful Code Editor with Container

The Powerful Cloud-based IDE Service
DEVELOP WITH EXCELLENCE
goormIDE is a powerful cloud IDE service to maximize the productivity for developers and teams.
Build your own development environment with just a few clicks. You can turn your ideas into SW anytime, anywhere.

- Edit, build, run and debug on the web-browser.
- Access to the Linux-based container via the fully-featured web-based terminal. 
- Install and configure anything whatever you want, just like your local machine.
- Edit source code in real-time and communicate with other teammates on the same environment.
- If problems occur, just rollback source code at any time.
- Connect your Git/Subversion repositories, easily. 
- Using gui-interface, just clone, edit, commit, push and pull your project.

Search for goormIDE in the Chrome Web Store !!
Functions in Daily Life
Tags: functions, func, ideasfordays, hmu
Published: 2020-01-17 06:29:25

To be honest, if you really wanted to, ANY process or task of real life can be broken down and defined into a function. Off the top of my head I can think of breakfast, showering, driving, cutting the grass and working out.
Breakfast can be broken down into ingredients, how many people you’ll be cooking for, how much time you have (if that is of importance) & perhaps even the number of ingredients you have if you don’t know what you are cooking yet. You could even have a function with if statements so that in case one of the conditions is not met, like the number of people changed, then something else can get executed.
Showering can be placed into a function in different ways, but one of them could be inside of an if statement. The if statement would be if cold water then certain time in the shower, else if (hot water) the more time in the shower. Inside the function time in the shower and time for each would be defined.
Driving can be in defined in a function by distance being traveled, destination, speed of travel & perhaps even miles or gas spend per mile depending on what is trying to be achieved. 
Cutting the grass is more challenging than the mere phrase “cutting the grass“ implies, to cut the grass, you have to get various materials ready, make sure the machine has gas & oil, get the trash cans closer & it can be broken down further to the actual process as far as how big the yard is and how any times you might have to go over it to complete the job. All of this can be calculated by a function. 
Finally, working out isn’t a task that is black and white. Depending on the individual, working out might consist of first stretching properly with various poses, then a warm up for whatever body part being targeted which usually consist of various exercises & finally, the workout itself, which is conglomerate of more exercises. All of this can be put into a function to decide or calculate what exercises will be executed for the current day.
CI for Ruby on Rails: GitHub Actions vs. CircleCI
Tags: rails, ruby, circleci, github
Published: 2020-01-17 20:34:45

# CI for Ruby on Rails: GitHub Actions vs. CircleCI

_This is part of a three part series where I will walk you through setting up your CI suite with GitHub Actions, CircleCI, and then comparing which you may want to use if you are setting up continuous integration for your Rails app._

## Part 3: Comparison

You can find the conclusion of this series on the [CodeFund Blog](https://codefund.io/blog/ci-for-ruby-on-rails-github-actions-vs-circleci).

Thanks for following along!