Posts tagged with macos

  • Recently my work computer switched from a Windows box to a MacBook Pro, which reminded me of this feature in iTerm (I had been using this feature on Console2 on Windows): The Quake Terminal controlled by Alt + \`. In iTerm preferences: Under Keys, select Hotkey Press to \*Create a Dedicated Hotkey Window\...\` Set the Hotkey to Opt + \` Configure it to only "Animate showing and hiding" After that iTerm creates a Hotkey Window profile that is assigned to the iTerm pane that drops from top of the screen each time. To make this work well with multiple screens, select the Hotkey Window profile, and under the Window tab, pick "Screen with Cursor" for the Screen picker.

  • While I consider myself a frontend developer, and find the most joy and energy from working in JavaScript and the browser, my roles have traditionally been full stack, and I've always been in a position where I know just enough about the backend stack of the projects I work on to be dangerous and unblock myself. Last month, I rejoined the team at one my previous employers, but I've into a new (and admittedly, desirable) situation: The backend that I work with is in Python instead of C#.NET. I've dabbled in Python in the past for simple scripting and automation, but I haven't really taken a deep dive into building a non-trivial tool in Python yet, so it's a good time to take a dive into Python and get set up. I do nearly all my personal development on macOS, so the following will be written with that in mind. There are many ways to get Python installed and get a suitable environment established for development, but what I've chosen is pyenv and poetry. macOS ships with Python, but it's not a recent version, and it's managed by the system. To ease management of dependencies and updates, I'll be installing pyenv through Homebrew. Homebrew provides a package manage for macOS, similar to linux package managers like dpkg or RPM, commonly via as apt or DNF/yum respectively. Beyond running brew install pyenv, there's some set up to be followed in the pyenv repo. At this time, the latest release of pyenv is 2.2.5, which has 3.10.3 at the latest release of Python available, so install that and set it as the global python. Python dependency isolation is usually handled through virtualenvs or venvs, which will allow package installation to occur within that environment and not affect the base python install. Coming from the JavaScript ecosystem, where npm and yarn make dependency management and dependency isolation incredibly painless, I opt for using poetry, which provides a similar experience to frontend package management. Poetry will even create a virtualenv automatically and manage dependencies for the project in there, so it's often ready to use on a new project with minimal effort. The recommended method to install poetry is through its installer script. poetry installs to \~/.local/bin, which should already exist in $PATH on macOS. Once it's installed, create a new project directory, and initialize poetry in it. Follow the prompts to set up poetry for that folder. After that, dependencies can be added with poetry add, not disimilar to yarn. If a virtualenv doesn't exist at this point, it will be created when adding the package. After that, poetry run can be used to run scripts and executables in its environment. There we have it, Python running in a npm-like configuration on macOS.