- Drag a file onto the terminal to get its path put on the command line
- In the Finder
⇧⌘G
gives a dialogue box to open a location, that can use tab completion. - Pressing
/
or⇧⌘G
in any file picker dialogue will give you the same file location dialogue box. - Show/hides hidden files in a save dialogue box:
⇧⌘.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function set-secret { | |
# TODO: handle signals: an ill-timed signal could leave the user | |
# with a non-sane terminal, which can really foul things up | |
# even for experienced users | |
ME='set-secret' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pbmunge { | |
if [[ "$1" ]] && echo "$1" | grep -q -e '^-h$' -e '^--help$' | |
then | |
echo 'Usage: pbmunge utility [util-arg ...]' | |
echo '' | |
echo "Filter (or munge) contents of the macOS pasteboard using \`utility'" | |
echo " \`utility' will be invoked with any supplied util-arg(s)" | |
echo '' | |
echo 'Example: increase the quote level of a plain text email' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to be run as your `PROMPT_COMMAND`, this will log any invocations of `defaults write` | |
# now you stand a chance of figuring out which time when you pasted something from a | |
# random website into your terminal months ago is now totally screwing up your mac | |
function __log_defaults_writes { | |
local DEFAULTS_WRITES_HISTORY="$HOME/.defaults_writes" | |
if history 1 | grep -F -q 'defaults write' | |
then | |
chmod u+w "$HOME/.defaults_writes" # make log file writeable | |
echo -en "$(date +%Y%m%d.%T):\t"$'\t' >> "$DEFAULTS_WRITES_HISTORY" # add timestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This has to be run on macOS, because it relies on `plutil(1)` to convert binary Info.plist files | |
# into ASCII xml plist files. If you know the Info.plist will not be binary, you should be able to | |
# run this on other systems with minimal modification | |
# we pass the file path of the .ipa and array of plist keys to retrieve | |
# returns: a dict of the plist keys and their values as found in the app’s Info.plist | |
def get_attritubes_from_ipa(ipa_file, attributes): | |
retval = {} | |
zip_archive = zipfile.ZipFile(ipa_file, 'r') |
Here are links and follow-up notes from the ASCII Art Tips & Trick talk by Dustin Goldman, originally presented at the [Creative Coding X meetup][1].
Dustin hopes you enjoyed the talk. If you have any questions, feel free to contact him on twitter, where he is [@roosto][2]
per the [FIGlet website][3]:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all the custome .cow files from https://github.com/roosto/cowtip | |
# Author: Dustin Goldman <[email protected]> | |
##### ducks.cow ##### | |
$the_cow = <<COW; | |
$thoughts | |
$thoughts | |
>(.)__ <(.)__ =(.)__ | |
~~~~~~~~~(___/~~~(___/~~~(___/~~~~~~~~~ | |
COW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function party { | |
if ! command -v figlet > /devc/null; then | |
if ! command -v brew > /dev/null; then | |
echo Requires figlet or brew to be installed 1>&2 | |
return 1 | |
fi | |
brew install figlet || exit $? | |
fi | |
if [ -z "$1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# roosto’s “Code Golf” v3 149 characters | |
# problem is #8 here: http://codegolf.stackexchange.com/questions/16707/9-hole-challenge | |
# | |
# The basic idea here is to go line by line, looking through the current line for whitespace. | |
# When we find a whitespace character we see if the character above it needs | |
# to have a non-whitespace character, a.k.a. a “supporting” character below it. | |
# If the “supporting” character above the whitespace character is not '/' or '\', a.k.a. a “bracing” character, | |
# then shit is fucked. We make comparisons easier and severely limit corner cases by | |
# kinda normalizing the input with a few regexs before we get into it. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************** | |
Dustin Masterson aka @roosto | |
If you have been logged out of jenkins and you open your browser and your | |
browser reopens a slew of tabs from your jenkins instance, each page will | |
redirect you to a login page. | |
Annoyingly even after you login on one of these login pages, reloading | |
another page will still load the login page, instead of the page that you |