To open a file in Vim:
vim <filename>
| Navigation | |
|---|---|
h |
move one character left |
j |
move one row down |
| /** | |
| * Many use the MDC fallback implementations (eg. for | |
| * [indexOf](http://goo.gl/SIyI35)). They're generally rigorously | |
| * standards-compliant, even to the extent of explicitly checking the types of | |
| * all the arguments. | |
| * | |
| * Unfortunately whilst it is clear that the authors regard this code as | |
| * trivial and freely-usable, there doesn't seem to be an explicit | |
| * licence-grant to put this in writing. The wiki as a whole is CC | |
| * Attribution-ShareAlike, if that's an acceptable licence (though CC isn't |
| Name | Description | Exceptions |
|---|---|---|
| Avoid async void | Prefer async Task methods over async void methods | Event handlers |
| Async all the way | Don't mix blocking and async code | Console main method |
| Configure context | Use ConfigureAwait(false) when you can |
Methods that require context |
Windows PowerShell has several transition aliases that allow UNIX and CMD users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists.
| CMD Command | UNIX Command | PowerShell Command | PowerShell Alias |
|---|---|---|---|
| dir | ls | Get-ChildItem | gci |
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| try: | |
| # python 3 | |
| import http.client as httplib | |
| except ImportError: | |
| # python 2 | |
| import httplib |
| #!/usr/bin/env python | |
| """Replace line breaks, from one format to another.""" | |
| from __future__ import print_function | |
| import argparse | |
| import glob | |
| import os | |
| import sys |
| title | Disable macOS Firewall Logging |
|---|---|
| date | April 9, 2017 |
| author | Jon LaBelle |
| source | https://jonlabelle.com/snippets/view/markdown/disable-macos-firewall-logging |
Steps for disabling macOS Firewall logging to the appfirewall.log file.
NOTE: Only disables logging, not the Firewall itself.
| using System; | |
| using System.Threading.Tasks; | |
| using System.Collections.Generic; | |
| using System.Collections.ObjectModel; | |
| using System.Diagnostics; | |
| using System.Net.Sockets; | |
| namespace ConsolePortScanner | |
| { | |
| class MainClass |
| title | npm vs Yarn Command Translation Cheat Sheet |
|---|---|
| subtitle | CLI commands comparison |
| author | yarn |
| date | February 15, 2020 |
| source | https://yarnpkg.com/en/docs/migrating-from-npm |