Skip to content

Instantly share code, notes, and snippets.

@jonlabelle
jonlabelle / resolving_git_line_ending_issues_in_docker_containers.md
Created Dec 8, 2021
Resolving Git line ending issues in Docker containers
View resolving_git_line_ending_issues_in_docker_containers.md

Resolving Git line ending issues in Docker containers

How to resolve Git line ending issues in Docker containers resulting in many modified files.


Since Windows and Linux use different default line endings, Git may report a

@jonlabelle
jonlabelle / ANSI.md
Created Aug 14, 2021 — forked from fnky/ANSI.md
ANSI Escape Codes
View ANSI.md

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@jonlabelle
jonlabelle / Dockerfile
Last active Aug 10, 2021
Docker image for running Yarn v2+ on the latest version on Node.js.
View Dockerfile
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 Apr 1, 2022
Change GitHub default branch from master to main.
View change_default_git_branch_to_master.md

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 Dec 9, 2021
This page contains a list of commonly used kubectl commands and flags.
View bem_cheatsheet.md
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 May 24, 2021
Gets the file name or directory portion of a path. Similar (but not exact) to the posix BASENAME(1) command, written in PowerShell.
View Get-Basename.ps1
function Get-Basename
{
<#
.SYNOPSIS
Gets the file name or directory portion of a path.
Similar (but not exact) to the POSIX BASENAME(1) command, written in PowerShell.
Author: Jon LaBelle
License: MIT
@jonlabelle
jonlabelle / compare_versions.sh
Last active Apr 5, 2022
Compare Semver Versions in Bash
View compare_versions.sh
#!/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 May 21, 2021
npm version cheatsheet
View npm_version_cheatsheet.md

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.