Skip to content

Instantly share code, notes, and snippets.

@TravisCarden
TravisCarden / README.md
Last active January 8, 2024 03:16
iTerm2 status bar component for the latest Git commit message

iTerm2 status bar component for the latest Git commit message

screenshot

Generate the component text

# bash: Place this in .bashrc.
# zsh: Place this in .zshrc.
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
@TravisCarden
TravisCarden / finicky.ts
Last active October 21, 2026 19:32
Open ClickUp, Spotify, and Zoom links from anywhere in their desktop apps
import type { FinickyConfig } from "/Applications/Finicky.app/Contents/Resources/finicky.d.ts";
/**
* Fully decode a URL string, even if it is encoded more than once.
*/
function decodeRepeatedly(url: string): string {
let current = url;
while (true) {
try {
const decoded = decodeURIComponent(current);
@TravisCarden
TravisCarden / phpcs-sniffs.md
Last active August 16, 2023 18:50
List of all built-in sniffs in PHP_CodeSniffer (PHPCS) v3.6.2

Built-in sniffs in PHP_CodeSniffer (PHPCS) v3.6.2

Following are all the sniffs included in a default Composer installation of PHP_CodeSniffer (PHPCS).

Wed May 25 15:30:44 EDT 2022
PHP_CodeSniffer version 3.6.2 (stable) by Squiz (http://www.squiz.net)
The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1 and PSR12
@TravisCarden
TravisCarden / php-exceptions.md
Last active April 10, 2023 12:35
List of all PHP exceptions

All PHP exceptions up to PHP 8.1

All, with Hierarchy

  • Exception (PHP 5, PHP 7, PHP 8) is the base class for all user exceptions.
    • ErrorException (PHP 5 >= 5.1.0, PHP 7, PHP 8) is an Error Exception.
    • LogicException (PHP 5 >= 5.1.0, PHP 7, PHP 8) represents an error in the program logic. This kind of exception should lead directly to a fix in your code.
      • BadFunctionCallException (PHP 5 >= 5.1.0, PHP 7, PHP 8) is thrown if a callback refers to an undefined function or if some arguments are missing.
  • BadMethodCallException (PHP 5 >= 5.1.0, PHP 7, PHP 8) is thrown if a callback refers to an undefined method or if som