Skip to content

Instantly share code, notes, and snippets.

@tspng
tspng / .iterm-colours.zsh
Created January 31, 2024 08:44 — forked from aclarknexient/.iterm-colours.zsh
Set iTerm2 tab colours based on the command you are running
# A dotfile to turn iTerm2 tabs a different colour based on the command glob.
# Useful for marking different environments in different colours.
# Cargo-culted from multiple sources, apologies for not fully acknowledging them :(
# Edit the line that reads "if [[ "$1" =~ "^(login-helper) " ]]; then" and replace
# "login-helper" with whatever command you use to authenticate. Then modify the case
# statement to match your auth command's arguments. For example: you may use a script
# called "authsaml" to authenticate, and its arguments are dev, test, preprd, and prd.
# Change the colour function you call if you want to change tab colours.
@tspng
tspng / iTermColorsToTerminalColors.swift
Created November 26, 2023 09:17
Convert iTerm2 color scheme to Terminal.app color scheme (Swift 5 Compatible)
#!/usr/bin/xcrun swift
//
// Copyright © 2016 Leon Breedt
// Ported to Swift 5 by Pablo Morelli 2019
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@tspng
tspng / gitcheats.txt
Created February 4, 2016 14:24 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# cherry pick range of commits, starting from the tip of 'master', into 'preview' branch
git rev-list --reverse --topo-order master... | while read rev; do git checkout preview; git cherry-pick $rev || break; done
# create tracking branches for all remote branches
git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs;
# git reset newly added files