We will use:
Source code: d-dmytro/my-typescript-app
Let’s create a folder for our project:
npm init to create the package.json file in this folder. I’ve chosen defaults for the options.
Let’s install TypeScript and the types for Node.js as dev dependencies.
npm i -D typescript @types/node@12
I installed the types for Node.js 12 because that’s the version I’m using in this project. If you are using a different version, replace “12”…
My goal in this tutorial is to show how to structure React components around forms. In order to demonstrate this, I’d like to build a simple Newsletter subscription form.
The form contains the email address input and the submit button. Once the user submits the form, we should validate the email and display an error message if the validation fails. If validation succeeds, we display a success message. Simple, hah?
I’d split this form into 3 React components:
We can use a nice perl one liner in the terminal to process files line by line. We can do many interesting things with it:
Lets go through a few examples. I created a file with a list of animals and named it animals.txt:
First, lets replace lion with Lion King in the content of this file:
perl -p -e '$_ = qq(Lion King\n) if /lion/'…
Before diving into advanced command line usage examples, I’d like to explain another basic concept — piping. Piping is the inter-process communication mechanism that allows to send the output of one program to another program. To pipe programs together in a shell, we use the vertical bar character |. The general syntax is:
command one | command two [| command three …]
What happens when you pipe 2 programs?
The shell creates a process for each program and arranges the necessary connections between their standard streams. …
Let’s start with the basics. What do the standard streams do?
A program running in a Unix-like operating system can read and write from/to one of the 3 standard streams: