CategorySoftware Development

5 Awesome Vim Plugins You May Never Have Heard About

5

I’ve been browsing people’s dotfiles recently and found some very cool Vim plugins which I’ve never seen before. So I thought I need to spread the word. Buftabline — buffer list that lives in the tabline Buftabline You might have heard that Vim users would rather use buffers instead of tabs, which is a more native way to work with files in Vim. To me, it was always a bit...

Converting A Stateful React Component To Function With Hooks

C

For a long time if we wanted to create a stateful component in React we needed to create a class and inherit it from React.Component. But dealing with classes can be a frustrating experience and contradicts the functional nature of React itself. I wrote a rant article on that before. With the release of React v16.7.0-alpha, React team proposed a way to create stateful components based on...

How To Edit A Vim Macro?

H

I use macros (by the way this is plural of macro) pretty often in my daily workflow. There are always some tasks that you need to do quickly on a large text file, and that’s where macros shine. Sometimes though it’s not trivial to get a macro right from the first time. But do you know there’s a simple hack to modify an already recorded macro without re-recording it? First, a...

The Pipeline Operator In JavaScript

T

There is a very early proposal for the next version of JavaScript (aka ESNext proposal) which I’m really eager to see making it through. I’m talking about the pipeline operator “|>”. Immediately, all the guys coming from the functional world know what I’m talking about. Pipeline operator has been for some time in Elm, Elixir, and many other functional languages...

Setting up Webpack 4 and Babel 7 for React Step By Step

S

In this article, I’m going to quickly show how to start a new React app with Webpack 4 and Babel 7. This is going to be a no-bullshit step-by-step guide. Spoiler: it’s very easy. Create a new directory with mkdir test-react-app && cd test-react-app Init the package.json with command npm init -y (-y flag means don’t ask just create it) Install Webpack npm install webpack...

Vim for JavaScript and React in 2019

V

In this article, I’d like to share some of the Vim plugins that will transform your Vim into an IDE for JavaScript and React (step back, VS Code!). Note: I will only talk about JavaScript-specific plugins here. For must-have general-purpose plugins see my other article. Syntax highlighting Many of the old syntax plugins for JavaScript have troubles with some modern features like arrow...

React without “this”

R

For some weird reason, even though React is rather functional in its philosophy (compare higher-order components and higher-order functions), they decided to use classes for components with a state. I want to stress it — the heavy classes usage in React is a mere API choice. There is nothing about React or its core values that couldn’t be represented with pure functions. But classes add up...

Vim search and replace

V

Search and replace. How do you do this in Vim? The basics :s/fn/function/g 1 :s/fn/function/g %s stands for “substitute” here. In this example, we’re replacing all the occurrences of the “fn” string with “function” in the current line. The "g" flag at the end specifies that we need to do this globally, i.e. throughout the whole line. Usually though you...

How to track retention and other metrics with Rails

H

As someone who can’t stop coming up with new side-projects written in Rails, I know how crucial it is to give attention to your data. It’s very important to understand some key metrics, like how many users being registered in a particular week, how many users continue using the product (retention), what are the features being used, etc. Here’s an example of the real admin...

How to copy and paste a line in Vim?

H

One of the most common task that beginners struggle to do in Vim is copying and pasting a line. In reality though, it is very simple. Type "yy" to copy a line, then "p" to paste it into the other place. 1 Type "yy" to copy a line, then "p" to paste it into the other place. Now if you have some time, let’s take a closer look at what’s happening there. To copy a line, Make sure...

Recent Posts

Categories

Meta