Skip to content

Instantly share code, notes, and snippets.

@mikemcduffie
mikemcduffie / iterm2.md
Created September 1, 2025 07:55 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@mikemcduffie
mikemcduffie / print256colours.sh
Created August 31, 2025 22:10 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@mikemcduffie
mikemcduffie / README.md
Created April 2, 2020 16:22 — forked from joyrexus/README.md
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@mikemcduffie
mikemcduffie / gist:c9495673f80ebe76cde8
Created October 12, 2015 17:57 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@mikemcduffie
mikemcduffie / Resize Finder Window Icons.scpt
Created September 17, 2014 15:15
Applescript to Resize Finder Window Icons (View As Icons)
(*
Applescript snippet to resize front Finder Window icons
- Inspired by Dr. Drang's Quick switch to big Finder icons script (http://www.leancrew.com/all-this/2013/10/quick-switch-to-big-finder-icons/)
- Integrating into Dr. Drang's script is left as a trivial exercise for the reader :p
- Seriously, I've discovered a lot of cool programming/engineering/life information at Dr. Drang's site <hat-tip>, so I'm not going to steal his thunder by releasing a complete script as my own.
- Since every new OS X release deprecates Applescript programming even further, here's hoping 10.10 doesn't screw this up. I'm too jaded at this point to try the Yosemite beta.
*)