TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
Neovim and Vim both come bundled with a standard plugin called Netrw. Netrw acts a file explorer (similar to NERDTree), but more importantly has the ability to work with scp (as well as sftp, rcp, ftp, and lots of others :h netrw-nread
) to let you edit files and browse directories that are hosted on a remote machine, inside of your local Vim instance.
This is useful since you are able to use your Vim setup and plugins without copying over your dotfiles to the remote machine. As well, since the file is copied to your local machine, there will be no delay when typing.
This is optional for Vim, but required for Neovim (check this Neovim issue explaining why).
package main | |
import ( | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"sync" | |
) |
#include <libpq-fe.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
void close_connection(PGconn *connection, int code) { | |
PQfinish(connection); | |
exit(code); | |
} | |
// If the retrieved data is not a tuble |
If the input and output filenames don't contain spaces, quotation marks or other special characters:
ffmpeg -i input.webm -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 128k output.mp4
import os | |
import requests | |
import csv | |
import time | |
def fetch_all_users(api_key): | |
url = "https://api.clerk.dev/v1/users" | |
headers = { | |
"Authorization": f"Bearer {api_key}", |