Skip to content

Instantly share code, notes, and snippets.

approach with caution, might meltdown

Fahad Hossain fa7ad

approach with caution, might meltdown
View GitHub Profile
pdanford /
Last active Aug 2, 2021
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020

ralfr /
Created Jan 15, 2017 — forked from pdanford/
Applescript to launch iTerm2 Version 3+ from OS X Finder via keyboard shortcut or Toolbar


Based on info from but with modified behavior and fixed to work with iTerm2 version 3 or later. It will not work with older versions of iTerm. The modified behavior is to open a new terminal window for each invocation instead of reusing an already open window. Update - The original author released a build script for the newer iTerm2 versions at that keeps the original behavior of reusing an open iTerm2 window.

To open iTerm2 at selected folder with keyboard shortcut

  1. Run Automator, select a new Service
  2. Select Utilities -> Run AppleScript
  3. Service receives selected 'folders' in ''
  4. Paste script:
dethi /
Last active Mar 15, 2021
create-react-app: find files not used in the app bundle, i.e. unused source code
# Launch inside a create-react-app project after building the production build.
# Require `jq`.
diff \
<(find src -type f \( -name '*.js' -o -name '*.jsx' -o -name '*.css' \) | sort) \
<(cat build/**/*.map | jq --raw-output '.sources | join("\n")' \
| grep -v '\.\./' | grep -E '\.(js|jsx|css)$' \
| sed "s#^#src/#" | sort | uniq) \
hasinhayder / charlie-foxtrot.go
Last active May 20, 2020
converts a string to NATO phonetic alphabet equivalents
View charlie-foxtrot.go
/* Charlie Foxtrot - If You Know What It Means ;) */
package main
import (
hasinhayder / functions.php
Created Oct 29, 2014
Redirect WordPress posts to the editor if someone types /edit at the end of the permalink
View functions.php
function init_url_rewrite_rule(){
add_rewrite_endpoint( 'edit',EP_PERMALINK | EP_PAGES | EP_ATTACHMENT );
function redirect_edit_url(){