Skip to content

Instantly share code, notes, and snippets.

View jonlabelle's full-sized avatar

Jon LaBelle jonlabelle

View GitHub Profile
@jonlabelle
jonlabelle / Dockerfile
Last active August 10, 2021 23:48
Docker image for running Yarn v2+ on the latest version on Node.js.
FROM node:latest
# ----------------------------------------------------------------------------
# Gist: https://gist.github.com/jonlabelle/fafd49c64ce299ba7bd7227de0df995a
# ----------------------------------------------------------------------------
# Update NPM and Yarn to the latest versions
RUN npm install --global npm
WORKDIR /app
@jonlabelle
jonlabelle / change_default_git_branch_to_master.md
Last active September 10, 2024 07:15
Change GitHub default branch from master to main.

Change GitHub default branch from master to main

5 simple steps that I tested and used to make the change in under 1 minute.

  1. Move the master branch to main

    git branch --move master main
@jonlabelle
jonlabelle / kubectl_cheatsheet.md
Last active August 16, 2024 20:13
This page contains a list of commonly used kubectl commands and flags.
@jonlabelle
jonlabelle / bem_cheatsheet.md
Last active January 1, 2022 06:12
BEM cheatsheet
title subtitle date source
BEM cheatsheet
Block Element Modifier (BEM) naming convention cheatsheet.
June 13, 2021

BEM cheatsheet

The name of a BEM entity is unique. The same BEM entity always has the same name

@jonlabelle
jonlabelle / Get-Basename.ps1
Last active October 11, 2023 05:21
Gets the file name or directory portion of a path. Similar (but not exact) to the posix BASENAME(1) command, written in PowerShell.
function Get-Basename
{
<#
.SYNOPSIS
Gets the file name or directory portion of a path.
Somewhat similar to the POSIX BASENAME(1) command, written in PowerShell.
.DESCRIPTION
The Get-Basename cmdlet strips any prefix ending with the last slash
character present in string (after first stripping trailing slashes),
@jonlabelle
jonlabelle / compare_versions.sh
Last active October 6, 2023 19:02
Compare Semver Versions in Bash
#!/usr/bin/env bash
#
# Performs a simple semver comparison of the two arguments.
#
# Original: https://github.com/mritd/shell_scripts/blob/master/version.sh
# Snippet: https://jonlabelle.com/snippets/view/shell/compare-semver-versions-in-bash
# Gist: https://gist.github.com/jonlabelle/6691d740f404b9736116c22195a8d706
#
@jonlabelle
jonlabelle / npm_version_cheatsheet.md
Last active April 1, 2025 13:57
npm version cheatsheet

npm version cheatsheet

npm uses Semantic Versioning

npm uses Semantic Versioning. Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.
@jonlabelle
jonlabelle / dotnet-format-wrapper.sh
Last active August 16, 2021 09:44
Bash wrapper script for the .NET Format global CLI tool.
#!/usr/bin/env bash
#
# Bash wrapper script for the .NET Format global CLI tool.
#
# Author........: Jon LaBelle
# Date..........: February 4, 2021
# Snippet.......: https://jonlabelle.com/snippets/view/shell/net-format-bash-wrapper-script
# Gist..........: https://gist.github.com/jonlabelle/a0751768a220274a90d4be498da51643
# .NET Format...: https://github.com/dotnet/format
@jonlabelle
jonlabelle / dontet_unit_test_framework_translation_cheatsheet.md
Last active March 25, 2025 18:07
.NET Unit Test Framework Translation Cheatsheet