Nono.MA

AUGUST 13, 2020

While macOS ships with Python 2 by default, you can install set Python 3 as the default Python version on your Mac.

First, you install Python 3 with Homebrew.

brew update && brew install python

To make this new version your default add the following line to your ~/.zshrc file.

alias python=/usr/local/bin/python3

Then open a new Terminal and Python 3 should be running.

Let's verify this is true.

python --version # e.g. Python 3.8.5

How do I find the python3 path?

Homebrew provides info about any installed "bottle" via the info command.

brew info python
# python@3.8: stable 3.8.5 (bottled)
# Interpreted, interactive, object-oriented programming language
# https://www.python.org/
# /usr/local/Cellar/python@3.8/3.8.5 (4,372 files, 67.7MB) *
# ...

And you can find the path we're looking for grep.

brew info python | grep bin
# /usr/local/bin/python3
# /usr/local/opt/python@3.8/libexec/bin

How do I use Python 2 if I need it?

Your system's Python 2.7 is still there.

/usr/bin/python --version # e.g Python 2.7.16

You can also use Homebrew's Python 2.

brew install python@2

Before you go

If you found this useful, you might want to join my mailing lists; or take a look at other posts about code, Python, and macOS.

LAST UPDATED SEPTEMBER 22, 2020

If you are wondering where the audio files of your Apple Voice Memos are, in case you want to browse through them, see their file sizes, and copy or remove them, they are located in the com.apple.voicememos folder inside of ~/Library/Application Support.

That is, the Library folder inside of your macOS username. For instance, if your username was john, this would be the full path.

/Users/john/Library/Application Support/com.apple.voicememos

These audio recordings might have been recording on your Mac or your iOS devices (such as iPad or iPhone) and synchronized via iCloud. And even when your voice recordings appear in all your devices, Apple doesn't make it easy to find the audio files of your voice memos.

You can also drag and drop the recordings in the macOS interface to a Finder folder or to the desktop, or send them over AirDrop to your laptop from iOS. A tip I usually do is naming the files on iOS so when they're sent over AirDrop they are properly named.

Hope that helps!

JUNE 18, 2019

  • Menu bar · ctrl + fn + shift + F2
  • Dock · alt + ⌘ + D

DECEMBER 7, 2018

Here's a note on how to display dialogs, alerts, and notifications on macOS with AppleScript, useful to automate day-to-day tasks you do with your machine, or even create complex programs.

(To the uninitiated, you would run this code by opening the AppleScript Editor (on macOS), pasting the code there, and hitting run.)

Dialog and Alert1

display alert "This is an alert" buttons {"No", "Yes"}
if button returned of result = "No" then
	display alert "No was clicked"
else
	if button returned of result = "Yes" then
		display alert "Yes was clicked"
	end if
end if

System notification

display notification "Have a simple day!"

DECEMBER 15, 2017

To add a shortcut to your macOS Terminal, the only thing we need to do is to EXPORT that path in your bash profile. So go ahead and open the ~/.bash_profile file with a text editor, and add the following to the bottom of this file.

export MYFOLDER="/Users/username/Dropbox/folder"

This will add an environment variable $MYFOLDER to every new bash Terminal window you create. So you can navigate (or use the variable of this path) to this folder with:

cd $MYFOLDER

You can also type $MYFOLDER/other-folder —then press the TAB key— to expand the path shortcut to:

/Users/username/Dropbox/folder/other-folder

SEPTEMBER 21, 2015

iA Writer, The Sublime Text for Writing

First of all, I want to congratulate the iA team for the incredible improvements in both iOS and OS X versions of iA Writer 3.0—’it just works.’

I firmly believe that, if you use these apps on a daily basis, paying a total of $30 is a fair amount. The app costs $9.99 for iOS, $19.99 for OS X, and $4.99 for Android.

iA Writer, A Sublime Text for Writing.

The usability has improve a lot. The user interface is so much more intuitive an has been simplified a lot. Still, what was interesting to me is how they have adopted functionality which was present in other programs and seems to have been proved valid after a wide use.

For instance, I remember typing a couple years ago with Mou for OS X—which currently seems to be in an eternal state of free beta—where the split view with a live preview was one of the core features. Nevertheless, it seems like iA Writer has learned some of its core new functionality from Sublime Text.

Editing the Laravel project of nono.ma on Sublime Text

Library

One of the key successes of iA Writer 3.0 is the Library and its integration with iCloud and Dropbox. It syncs really well, and it caches the path of all your Dropbox text files at once, so it is really fluid when browsing files—unlike previous versions where every touch on a folder would fetch its contents from the Dropbox API.

iA Writer 3.0 using Focus, Night, and Typewriter modes, and displaying the new Library feature.

These feature was one the most comfortable ones inside Sublime Text, where you are allowed to open a whole project folder and navigate through it with ease.

Preview

As I said, Mou and other Markdown apps had a Preview function built in from the very beginning, but Writer always had this feature separate—its Preview would open a popup with the pre-visualization of your rendered Markdown.

iA Writer 3.0 using Day mode and showing a file Preview.

From 3.0, Writer joins the split view game, starting at a really small size that—I adventure to say—mimics the way Sublime Text works. It allows you to easily navigate your writings. If the small scheme is not what you are looking for, you can always click and drag to resize the Preview window, even up to the point where the writing window disappears and the Preview covers the whole screen.

Other Features

There are many other features which where already available inside iA Writer Pro, but have been polished in order to make the experience even better.

  • Focus mode (^D).
  • Day and night mode (^⌘M).
  • Typewriter mode (^T).
  • Syntax highlight (adjectives, nouns, adverbs, verbs, conjunctions).
  • Three text sizes.
  • Three templates for the Preview.
  • Format helpers.
  • Live stats (characters, words, sentences, reading time)

I am in no way related to iA Writer, and the only reason why I share it is because it makes my life so much easier every single day—and it may also make yours easier. It is simple, gorgeous, functional, and—most important—completely focuses on writing.

Download iA Writer | OS X | iOS | Android

MAY 29, 2015

The simplest way to zip a file or folder on Mac OS X—and to password protect it—is to run the following command on the Terminal.

zip -er archive.zip /path/to/directory/

After running the command (and only if /path/to/directory is a valid file or directory) you'll be prompted for a password. If you don't want to specify a password just omit the -er part. And, also, you can compress multiple files by specifying a list of files at the end.

zip -er archive.zip file1.jpg /path/to/directory anotherFile.zip

Want to see older publications? Visit the archive.

Listen to Getting Simple .