Skip to content

Instantly share code, notes, and snippets.

View jonlabelle's full-sized avatar

Jon LaBelle jonlabelle

View GitHub Profile
@jonlabelle
jonlabelle / vim_cheatsheet.md
Last active December 17, 2020 07:54
Vim Cheatsheet

Vim Cheatsheet

To open a file in Vim:

vim <filename>
Navigation
h move one character left
j move one row down
@jonlabelle
jonlabelle / js-shims.js
Last active January 27, 2019 00:21
JavaScript Shims
/**
* 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
@jonlabelle
jonlabelle / regular_expression_cheatsheet.md
Last active August 1, 2025 02:27
Regular Expression Cheatsheet

Regular Expression Cheatsheet

Anchors

^   Matches at the start of string or start of line if multi-line mode is
	enabled. Many regex implementations have multi-line mode enabled by
	default.

$ Matches at the end of string or end of line if multi-line mode is enabled.
@jonlabelle
jonlabelle / async_await_best_practices_cheatsheet.md
Last active April 7, 2026 14:46
C# Asynchronous Programming Guideline Cheat Sheet

Async Await Best Practices Cheat Sheet

Summary of Asynchronous Programming Guidelines

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 con­text
@jonlabelle
jonlabelle / windows_to_unix_command_cheat_sheet.md
Last active October 23, 2025 12:50
Windows to UNIX Command Cheat Sheet

Windows to UNIX Command Cheat Sheet

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
@jonlabelle
jonlabelle / closure.py
Last active November 2, 2018 09:21
Compiles JavaScript using the Closure Compiler Service API.
#!/usr/bin/env python
from __future__ import print_function
try:
# python 3
import http.client as httplib
except ImportError:
# python 2
import httplib
@jonlabelle
jonlabelle / crlf.py
Last active November 11, 2025 22:39
Replace CRLF (windows) line endings with LF (unix) line endings in files.
#!/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
@jonlabelle
jonlabelle / disable_macos_firewall_logging.md
Last active October 10, 2025 20:11
Disable macOS Firewall Logging
@jonlabelle
jonlabelle / ConsolePortScanner.cs
Created July 1, 2017 20:09
Simple async C# Open Port Network Scanner
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
@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active April 4, 2026 00:29
npm vs yarn command translation cheat sheet