How to find regex matches using PowerShell
Hidden color picker in Chrome dev tools
A hidden gem in the Chrome dev tools is the color picker
How to set up signing commits and tags with git on Windows
Install GPG4Win The easiest way to create and manage GPG keys is with GPG4Win. Download and install it, making sure ‘Kleopatra’ (the GPG key manager) is selected as a component to install. Create a new GPG Key Open Kleopatra and click New Key Pair. Select Create a personal OpenPGP key pair Enter your name and email address into the fields. If you want to verify your commits on GitHub or GitLab, make sure to use the same email address as the one on your account.
How to copy a website to read offline
Wget To mirror a website using wget run the following: 1 wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://site.example.com or the shorthand version: 1 wget -mkEpnp https://site.example.com Description of the parameters from the wget man page: --mirror turns on options suitable for mirroring including recursion, time-stamping, sets infinite recursion depth and keeps FTP directory listings. --convert-links converts links in the document to make them refer to the locally downloaded files.
Two tricks with the Chrome developer console
Copying to the clipboard with copy Suppose you want to copy the value of a variable to the clipboard. Rather than printing it out and then manually selecting and copying it you can do: 1 2 3 4 5 const a = "Something to copy ..."; copy(a); // Clipboard now has contents "Something to copy ..." You can also copy objects, which will be stringified to JSON:
Making WSL colors readable
The default color scheme for the Windows Subsystem for Linux (WSL) is not the most readable. Thankfully a tool exists that can change the default color scheme to something more legible. The default color scheme: The Windows Console Color Tool is a small utility for changing the cmd console colors and comes with some pre designed color schemes. You can get the latest code from the GitHub repository or download the first version as a zip file.
Bookmarks - April 2018
126.96.36.199 Despite being launched on April 1st, this was no April fools joke. Cloudflare made their own public DNS freely available. It’s fast, privacy focussed (no logging) and supports DNS over HTTPS, and DNS over TLS. * Check out https://188.8.131.52 * See the developer docs for info on setting up DNS over TLS and DNS over HTTPS. * See this guide for instructions on setting up DNS over TLS using unbound on OpenWRT.
Striping a HTML table with merged cells
A common style applied to HTML tables with lots of data is to make them striped, i.e. set the background color of alternate rows. This is easy to do when each tr represents an individual row to be striped, but if you have cells merged across multiple rows then this doesn’t work. When each tr represents a single row, the standard way of striping a table is with some CSS such as:
Editing Markdown in Visual Studio Code
What is Markdown? Markdown is a markup language written in plain text that can be transformed to HTML. It’s often used on forums and chat sites to write formatted responses. It’s also the markup language of choice for README files and documentation in software projects, primarily influenced by the popularity of GitHub, who created their own version of Markdown: GitHub Flavoured Markdown. Editing Markdown Files Create a Markdown file and open it in Visual Studio Code.
Entering passwords securely in Powershell
What’s a SecureString? A number of commands in Powershell require you to pass sensitive credentials such as passwords as a SecureString. A SecureString represents some plain text (a string) coupled with additional security oriented features: * The raw data is obfuscated rather than stored as plain text. * It’s ‘pinned’ in memory, i.e. it won’t get moved around or copied when the operating system is trying to optimize resources. * When it’s disposed, the memory it occupies is freed immediately.