Pip suddenly using wrong version of Python

I run with multiple Python versions and thus multiple pip versions as well. Everytime, however, you update pip, you’ll replace the standard pip command with the version you updated. So even pip3 install –upgrade pip will put a /usr/local/bin/pip in your system, messing up the Python 2 version. Instead, I run pip as an (executable) … Read more

How to create virtual hosts in MAMP?

While googling, I found these steps to easily create virtual hosts on MAMP: Open your console in mac and edit your hosts file like this sudo vim /etc/hosts This opens a system file that contains the following line: 127.0.0.1 localhost add your desired host name after local host: 127.0.0.1 localhost mysite.loc press ESC, then :wq! … Read more

What #defines are set up by Xcode when compiling for iPhone

It’s in the SDK docs under “Compiling source code conditionally” The relevant definitions are TARGET_OS_IPHONE (and he deprecated TARGET_IPHONE_SIMULATOR), which are defined in /usr/include/TargetConditionals.h within the iOS framework. On earlier versions of the toolchain, you had to write: #include “TargetConditionals.h” but this is no longer necessary on the current (xCode 6/iOS8) toolchain. So, for example, … Read more

How do you run a script on login in *nix?

From wikipedia Bash When Bash starts, it executes the commands in a variety of different scripts. When Bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads … Read more