teleren/devto huggingface dataset:
Editing remote files with Vim
Tags: vim, ssh
Published: 2020-03-30 09:31:30

---
title: Editing remote files with Vim
published: true
description: Edit files remotely via SSH, using only Vim
tags: vim, ssh
---

One of the lesser known features of Vim is the ability to edit files remotely, over the network.

This feature comes with the netrw plugin. To achieve this, netrw uses the SSH protocol, and manages remote files via the `scp` command.

Here’s how to do it:
```
vim scp://user@myserver[:port]//path/to/file.txt
```

Note the double `/` for the directory on the remote host, which is needed to correctly resolve the absolute path. `[:port]` is optional.

So with the command above you can open a file located on a remote host for editing.

What actually happens in the background is that Vim uses `scp` to download the requested file from a remote machine to a local `/tmp` directory, and then opens it for editing. 

When you save your changes to the file, the changes are first applied to a local copy in `/tmp` directory. After that, the file is uploaded via `scp` to the remote host.

If you open a directory on a remote host, you could also use netrw to browse through remote files and directories. The important thing is to always specify the directory path with `/` at the end.

Of course, it’s recommended that you use SSH keys for authentication. Otherwise, you might be asked for the SSH password too often.

Beside SSH, there are other protocols supported such as sftp, ftp, dav, etc.

For example, to open a file on a remote FTP server, you could run a command like:

```
vim ftp://hostname/path/to/file
```

Netrw offers lots of options and possibilities for remote editing, so for more information on this, take a look at `:help scp`.

---

What you've just read is an a section of *CHAPTER 6. WORKING WITH FILES* from the book [Mastering Vim Quickly](https://jovicailic.org/mastering-vim-quickly/).
Web Design Company
Published: 2020-03-30 06:49:40

Professional website design

Located in Pondicherry, LI Creative (https://licreativetechnologies.com/web-design-company/) offer you expertise in web design. Our experience allows us to offer simple solutions for small and large businesses. 

Buy or rent your website
Accessible for all budgets and turnkey. Creation of online store and professional websites optimized for search engines.

For more than 3 years, Li Creative Technlogies has been involved in the success of web design and development through its volunteer work and the creation of a new system for customizing lighting.

In collaboration with other partners, Li Creative  is setting up a CoWordking center to promote the start-up of young entrepreneurs. BusinessCaisse was launched in January 2018. Its services provide members with greater visibility and facilitate business relationships.

Having at heart the development of the sector which gave birth to it, Li Creative Design offers invaluable assistance to the Merchants of India.


WEBSITE DESIGN

Your site is tailor-made in our premises, thus allowing total control over the appearance and future additions of your new website.

UPDATING WEBSITES

To add quality features and / or content, choose a fast and efficient service.

WEBSITE OPTIMIZATION

With our expertise, optimize your site and ensure better referencing on search engines.

WEB HOSTING

A local service allows you to speak directly to an Internet hosting specialist.
The RxJS concatenation strategies, pt 1/4
Tags: javascript, rxjs
Published: 2020-03-30 09:17:23

As my journey into the marvelous world of RxJS goes on, I want to share a bit of knowledge I’ve got following courses, blogs and so on regarding the concatenation strategies.
First off, what is a concatenation strategy?
As you may probably know, RxJS is about streams of values, often handled asynchronously, as HTTP calls can be, that’s why it can happen that we have to use some sort of concatenation to keep our code execution in order, let’s see how.
Let’s put that we have a text box where we freely type anything, and that at each input typed by the user, we are sending 3 HTTP requests to a server, combining the letter typed with the numbers 1,2 and 3, and so on with every letter typed. In other words, if the user types “A”, the client will send three requests like:

[GET] /endpoint/A1

[GET] /endpoint/A2

[GET] /endpoint/A3

**FIRST STRATEGY: concatMap**
Given a stream of value (the user that types n times), the concatMap operator waits for each operation before initializing the next one.

![RxJS concatMap](https://res.cloudinary.com/practicaldev/image/fetch/s--PHpqDFAF--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/ulxj23cjhftyguvqdfmq.png)

Given our example above, the marble diagram here shows the first stream of values (A, B and C) which represent the values emitted by the user, and the stream 1,2 and 3 which represent our merge (“A1” , “A2” and so on).
Let’s follow step by step:
The user types A, and the value first merged value is emitted as a [GET]/endpoint/A1 , when the request is resolved then…

…the client starts [GET]/endpoint/A2 , when resolved then…

… the client starts [GET]/endpoint/A3, when resolved then…

…User types B, then…

[GET]/endpoint/B1 starts, and once resolved…

…[GET]/endpoint/B2 starts but…

…In the meantime the user types C, but our concatMap enqueues C1, C2, and C3 after B3 emission, so…

… [GET]/endpoint/B3 starts, and once resolved…

… [GET]/endpoint/C1 starts, and once resolved…

… [GET]/endpoint/C2 starts, and once resolved…

… [GET]/endpoint/C3 starts

Now even displacing B much much before the result won’t change, as you can se in this edited marble diagram below.

![RxJS marble concatMap 2](https://dev-to-uploads.s3.amazonaws.com/i/us7qe95d6e4wor2ehuv9.png)
And that’s pretty much it!

I hope that this concatenation strategy is a bit clearer :)
Monday is the New Friday
Tags: codenewbie, productivity, womenintech
Published: 2020-03-30 09:08:01

Something I've noticed over the past few weeks that I didn't realize before is the finite mental capacity we have each week. If we're going all-out day after day, it's recipe for burnout, loss of motivation, boredom - you know, all the fun stuff we simply assume is a just a necessary part of the work (hot take: it's not).

My week looks a little something like this: Monday through Friday, I spend anywhere from one to a few hours coding, learning - whatever it looks like to push me in the direction of where I want to be in the future. During those days, I give myself until around 6pm to do it, and if I don't - well, I just don't get my work done for that day (which I don't like, and which doesn't happen often, mind you).

After 6pm on weekdays, I dedicate my time to purely non-work activities - reading, spending time with my friends and loved ones, being outside, building a puzzle, watching Mad Men.

And then weekends, I don't code. I don't work. I don't stress out about sending in job applications or getting back to every email. Or at least I try my hardest not to.

Weekends are sacred and restful. And this is a huge transition from how I treated off-time in the past. Before, I was going nonstop, pushing myself well past any limits that may have been there. Now, I have a healthy separation between work time and rest/play/decompress time.

Restful weekends and evenings allow for us to recharge and get excited about the work we get to dig in to the next day or week. When Friday rolls around, I can really feel the difference in my energy level compared to Monday when I was fresh and ready to roll.

I love Fridays, but - dare I say - I think I may now love Mondays more.

_This post was originally published on February 28, 2020 on [my blog](https://alexlsalt.github.io/blog)._
The Unexpected Blessing of Being Out of Work
Tags: codenewbie, womenintech, javascript
Published: 2020-03-30 09:05:44

Yesterday I was inspired by someone on Twitter proclaiming the improvements to her overall life despite being out of work and on the hunt for a new job. And I fully, completely agree.

Fortunately, in my final months at my last job (which I left at the end of 2019), I was able to really put my head down and save up a hefty living expense fund that's set to last me several months. I knew I wanted to make the transition to become a software developer, and I also knew that I didn't want to be rushed and at the end of my rope financially when it came to finding the perfect fit for my career.

In the two months that I've been unemployed, I've done so, so much. Not to mention, I'm probably in the best place I've been physically, mentally, and emotionally - maybe ever.

Giving myself the opportunity for a long runway definitely took some planning and sacrifice in the months leading up to it, but I wouldn't have it any other way. I currently spend my days working through my JavaScript learning process, building projects, applying to jobs only (!!) if they inspire me and make me feel like I'd like to be a part of the team, going to the park with my pup, reading (so much reading), getting regular wonderful exercise, and getting at least 8-9 hours of sleep every night.

As I was leafing through my copy of How To Be Parisian Wherever You Are (love this sassy little book!), this passage stood out to me, especially during this particular period of my life:


_Take the time to talk to the elderly lady next door, to read a book, to walk to work instead of riding the subway when it's a beautiful day. Take the time to escape for a weekend with friends._

_Take the time to listen and to get to know yourself. Take the time to change, to grow, to rest. Take the time to say yes, take the time to say no. Take the time to look after your body, to eat well. Take the time to ask yourself who you are and what you want._

_..._

_Take the time to take time because nobody else will do it for you._


So, in this beautiful, lingering period of being between jobs and in the midst of a major career transition, here's to doing just that.

_This post was originally published on February 27, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Cleaner Code: Adding Methods to Objects
Tags: codenewbie, javascript, womenintech
Published: 2020-03-30 09:00:57

In my JS class, I've been building and erasing and rebuilding a quiz program to fully cement the process into my mind. While it's minorly distressing to erase code I've written, it's more worth it to write it over and over again as a means to getting better and better.

With this recent quiz program - I've built a Question function constructor to be used for the various questions within the quiz. Here's the bare bones of that constructor:

    
    function Question(question, answers, 
    correctAnswer) {
      this.question = question;
      this.answers = answers;
      this.correctAnswer = correctAnswer;
    }
  

When I get to the section of my program where I want to display a random question in my list of questions (I've left off the writing of these questions within this particular blog post, but just know that there are three different questions housed in an array, and they're accessed by a variable called random that makes use of the Math.floor, Math.random, and the questions' array length), I need to add a function called displayQuestion.

So, I could do the following to add the method to the Question object/function constructor as follows:

    
     function Question(question, answers, 
     correctAnswer) {
       this.question = question;
       this.answers = answers;
       this.correctAnswer = correctAnswer;
       this.displayQuestion = function() {
        console.log(this.question);
        
        for (var i = 0; i < this.answers.length; i++) {
          console.log(i + ': ' + this.answers[i]);
        }
      }
     }
   

The problem, though, is that it really isn't that clean or readable. So, the solution here would be to use the Object.prototype method to add the displayQuestion method to the Question constructor:

    
     function Question(question, answers, 
     correctAnswer) {
       this.question = question;
       this.answers = answers;
       this.correctAnswer = correctAnswer;
     }
     
     Question.prototype.displayQuestion = function() {
      console.log(this.question);
      
      for (var i = 0; i < this.answers.length; i++) {
        console.log(i + ': ' + this.answers[i]);
      }
    }
    
   

Now, we can clearly see that the displayQuestion method has been added to the Question function constructor. It wasn't totally necessary to add it in to the constructor itself. I like it!

_This post was originally published on February 24, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Faced with a Fork in the Road
Tags: codenewbie, womenintech
Published: 2020-03-30 08:58:52

While I'm committed to improving my programming craft between jobs, I'm still keeping an eye out for any positions that look great. Most notably, if there's a great remote position that catches my eye, I'm happy to package up a nice little application and send it on its way.

While the main goal is to make a successful career transition into programming, I've also had my eye on more technical support roles (to make for a smooth transition from pure customer support to something more technical and eventually full programming).

My main struggle with this thinking, though, is - why continue with support when I have the chance to make a complete and total transition into programming? Am I thinking in terms of limiting myself? Am I letting this scarcity mentality reel me back in when I consider the amount of work I still need to put in to gain these skills?

The most difficult thing about it is the fact that my intuition is fully nudging me in the direction of working to become a full programmer. But I do want to work. I want to be a part of a team now. I want to continue on with my financial goals of fully paying off my student loans and investing in my future.

But I can't help but wonder if I'll end up letting the shorter-term job acquisition blur the truer, grittier goal of mastering my craft and launching head-first into the field of programming.

_This post was originally published on February 21, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Weekend Breaks from Coding
Tags: codenewbie, womenintech
Published: 2020-03-30 08:56:04

It may seem counterintuitive to take breaks over the weekend when learning to code or when you're practicing to really improve your skills, but I've recently learned that taking a couple of solid days off from coding and mental gymnastics is such a cool thing.

Not only do you come back to your text editor on Monday with renewed motivation for getting back to your projects, but you also have this pool of creativity that almost seems to be bubbling over. What I mean is that those couple of days you gave your mind to take a rest gave it the opportunity to come up with so many great new ideas that you're excited to bring to your own coding practice when the time comes to sit down at your computer.

This past weekend, we took a break from the city and headed to the French countryside to be with my partner's family. We relaxed, enjoyed great meals, drank champagne, and played Monopoly.

And from that, I got inspired to code up my own version of Monopoly! I've yet to start, but I can tell you my brain has already gotten started with mentally laying things out. Stay tuned for that!

_This post was originally published on February 18, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Enlightened Self-Interest
Tags: codenewbie, womenintech
Published: 2020-03-30 08:54:02

This quote serendipitously came into my life recently, and I haven't been able to get it out of my head:

_Striving is fine, as long as it's tempered by the realization that, in an entropic universe, the final outcome is out of your control. If you don't waste your energy on variables you cannot influence, you can focus much more effectively on those you can. When you are wisely ambitious, you do everything you can to succeed, but you are not attached to the outcome-- so that if you fail, you will be maximally resilient, able to get up, dust yourself off, and get back in the fray. That, to use a loaded term, is enlightened self-interest._

(Dan Harris, 10% Happier)


If this isn't something that inspires consistent action day after day after day, then I don't know what is.

Each time I come up against something that's really tough right at the beginning, I think of this quote just as my motivation starts to slip. And each time I do something a bit out of my comfort zone (apply to a job that's way out of my league, start in on a complicated side-project, or get rejected in any way), I think of this and of how important not being overly attached to the end result is.

It's a bit like a 'what's the worst that could happen' reminder paired with the idea that everything always works out in the end - and it definitely gives me a healthy dose of perspective to keep on keepin' on.

_This post was originally published on February 13, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Learning is Not Linear
Tags: codenewbie, womenintech
Published: 2020-03-30 08:50:55

Learning is not linear. It involves ups, downs, peaks, dips, plateaus, drops, rises, falls, rinses, and repeats.

Keep going, keep practicing, keep learning. One day in the near future, you'll be breezing through that which is stumping you today.

_This post was originally published on February 12, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Make Time to Make Time
Tags: codenewbie, womenintech, productivity
Published: 2020-03-30 08:46:03

Yesterday I was inspired by a [YouTube video](https://www.youtube.com/watch?v=WK-sZjuXA6A) that was serendipitously recommended to me on my feed. I started to think about the idea of 'making time.'

Making time to take care of ourselves, making time to cook high-quality meals, making time to sit down and learn or code in a highly focused manner - instead of flying by and trying to get everything done in a 30-minute time slot.

This idea is great motivation for not simply checking every little thing off the to-do list in a very half-assed and not fully committed way, but instead, accomplishing bigger tasks that move the needle in a more significant way.

Along that same line, here's an excerpt I really love from Jason Fried's post on the Signal vs Noise blog:

_There are lots of ways to carve up an hour. 10 x 6. 15 x 4. 30 x 2. 45 + 15. 20 + 20 + 20. The key is not to carve it up. And when you stack it up – one full hour after another – you really see the compound benefits of uninterrupted time._

I love the idea of being able to fully complete any tasks we have on our plates by leveraging the power of truly uninterrupted time. I'm thinking of a task that we fear will take us the entire day, and then when we sit down to focus solely on that project, it ends up taking a true fraction of the expected time.

It really all starts with being mindful, and making the time, to do our best work and live our most enjoyable lives.

_This post was originally published on February 6, 2020 on [my blog](https://alexlsalt.github.io/blog)_
Refactoring My Tip Calculator Program
Tags: codenewbie, javascript, womenintech
Published: 2020-03-30 08:43:09

In one of my exercises from my JS course yesterday, we had to create an object,     john, representing a person and the number and prices of meals he had on vacation and how much he tipped with each meal. According to instructions, he preferred to tip as follows:

- For meals less than $50, tip 20%
- For meals between $50 and $200, tip 15%
- For meals over $200, tip 10% (I know - I wouldn't want to be John's server either.)

Here's the code I started off with for calculating both the individual tips he gave for each meal, as well as each total meal cost (cost of meal with tip included):
    ```          
      var john = {
        bills: [124, 48, 268, 180, 42],
        tips: [],
        totalMealCosts: [],
        calcTip: function(){
          var tip;
          var totalMealCost;
          
          for (let i = 0; i < this.bills.length; i++) {
            var bill = this.bills[i];
            if (bill > 0 && bill < 50) {
              tip = bill * 0.2;
              totalMealCost = bill + tip;
            } else if (bill >= 50 && bill <= 200) {
              tip = bill * 0.15;
              totalMealCost = bill + tip;
            } else {
              tip = bill * 0.1;
              totalMealCost = bill + tip;
            } 
          this.tips.push(tip);
          this.totalMealCosts.push(totalMealCost);
          } 
        }
      };
     ```           


And then after some refactoring, this is my final program (manually transpiled from ES5 to ES6):

    ```       
      const john = {
        bills: [124, 48, 268, 180, 42],
        tips: [],
        totalMealCosts: [],
        calcTip: function(){
          let totalMealCost;
          let tipAmount;
          for (let i = 0; i < this.bills.length; i++) {
            let bill = this.bills[i];
            let percentage;
             if (bill < 50) {
              percentage = 0.2;
            } else if (bill >= 50 && bill <= 200) {
              percentage = 0.15;
            } else {
              percentage = 0.1;
            } 
          
          tipAmount = bill * percentage;
          totalMealCost = bill + tipAmount;

          this.tips.push(tipAmount);
          this.totalMealCosts.push(totalMealCost);
           } 
         }
       };
    ```

The main thing here is the fact that I removed the tipAmount and totalMealCost variables from each tipping condition and moved them instead to the end of the for loop.

I'm working more on not repeating myself in my code, and I'm realizing that it all comes down to practicing and eventually reaching higher skill levels - after a certain amount of time, thinking about how your own code could be improved becomes as natural as anything.


_This post was originally published on February 5, 2020 on [my blog](https://alexlsalt.github.io/blog)_
The Power of Learning Over and Over Again
Tags: codenewbie, javascript, womenintech
Published: 2020-03-30 08:38:56

I'm always overjoyed when something that I've been working on mastering/learning for some time finally settles in with that ephemeral click.

Today I finished up the Basics section of my JavaScript course, and I'm very proud to say that I flew through it with soaring colors. I wish I could go back to my past self when she was just settling in to trying to figure out what JavaScript was, tap her on the shoulder, and let her know that everything was going to come full circle and click one of these days.

The secret is in putting in the effort day after day after day, even (and especially) when things aren't making sense. It takes learning something (like rock-solid JS foundations) over and over again before the concepts will seem familiar and - dare I say - enjoyable.

Proudest moments of the day:

- Fully understanding the use of the this keyword in multiple exercises
- Writing a solid, functional tip-calculating program from objects and methods


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