Skip to content

Instantly share code, notes, and snippets.

View jonlabelle's full-sized avatar

Jon LaBelle jonlabelle

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / iis7_command_line_tool.md
Created April 17, 2014 21:41
IIS 7 Command Line Tool

IIS 7 Command Line Tool

AppCmd.exe IIS 7 command-line tool used to perform common IIS administrative tasks such as creating new sites, stopping/starting services, and viewing status of the site.

Usage

appcmd (command) (object-type) <identifier> </parameter1:value1 ...>
@jonlabelle
jonlabelle / node-static-file-server.js
Created March 21, 2014 16:25
Simple node.js static file server.
var path = require('path');
var fs = require('fs');
//
// Configuration
//
var config = {
@jonlabelle
jonlabelle / aspdotnet-razor-syntax-reference.md
Last active September 27, 2025 02:39
ASP.NET Razor Syntax Reference

ASP.NET Razor Syntax Reference

Code Block

@{
    int x = 123;
    string y = "because.";
}

Expression (Html Encoded)

@jonlabelle
jonlabelle / television_resolution_standards.md
Last active April 28, 2026 02:39
Digital and analog television standards resolution reference.

Television Standards

Digital and analog television standards resolution reference.

Digital TV Standards

Standard Resolution (dots × lines) DAR (H:V) Pixels
PixelVision 120 × 90 4:3 10,800