26 July 2013

How to flip or rotate an image in Evernote using Skitch

This is very simple. I'm just going to post 3 images that will explain how to do this:



It's that easy. Enjoy.

20 July 2013

Install Python, Virtualenv, Virtualenvwrapper on OS X using Homebrew: The world's easiest guide

The world's simplest instructions in the world for installing Python, virtualenv, virtualenvwrapper on OS X using Homebrew for Apache and MySQL.

1) Apache: Use OS X's Apache installation. To run and test apache :
sudo apachectl start
sudo apachectl stop

sudo apachectl restart

2) Bashrc/Bash_Profile: If you don't have ~/.bashrc or ~/.bash_profile create them using.
touch ~/.bashrc
touch ~/.bash_profile

(unlike other terminal apps in the Linux/Unix world OS X terminal.app runs .bash_profile every time you open a new terminal window. See this excellent piece on the topic. We will come back to these files in a minute)

3) Installing Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Then run:
brew doctor

4) Install Python. OS X comes with Python, but you want to install the latest 2.x version using Homebrew.

brew install python

5) Upgrade the distribution:

pip install --upgrade distribute

6) Upgrade install pip:

pip install --upgrade pip

7) Install virtualenv:
pip install virtualenv

8) Install virtualenvwrapper:

pip install virtualenvwrapper

9) Install MySQL:

brew install mysql

(to start/stop or restart MySQL type: mysql.server start/stop/restart)


10) Install MySQL-python, needed for python to talk to MySQL:

pip install MySQL-python

11) Your Path:

sudo nano /etc/paths

make sure /usr/local/bin comes before /usr/bin. Mine looks like this:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

12) Environment Variables: Set your .bashrc and .bash_profile to include these entries respectively:

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

(this is for .bashrc)

source ~/.bashrc

(This is for .bash_profile. Basically, .bash_profile runs every time you create a terminal window and it calls .bashrc which in os x only runs when you log in to a terminal window)

also run:

source ~/.bash_profile
source ~/.bashrc

(to execute these changes)

13) Get started. Some basic commands:
Create a new project:
mkvirtualenv MyProject (the project files are in ~/.virtualenvs)
Work on the project:
workon MyProject
Install stuff:
pip install django
Get out of there:
deactivate
Remove it:
rmvirtualenv MyProject

It's that simple! Enjoy. (Thanx Josh)

10 August 2012

Why MAMP is Better Than XAMPP?

Just thought I would post a very quick little point for those working with a local server on a Mac. It's pretty easy to set up the built in server on the Mac and do it that way, but personally I prefer just using a pre-packaged solution.

For years I've been using XAMPP. Not sure why I thought it was better. On Windows it's definitely a great choice. But on OS X it's not. The trouble is XAMPP has not been updated in quite a while on the Mac side. So, you'll be using pretty old versions of PHP and MYSQL. Also, there are lots of glitches with it. For instance, it doesn't correctly set folder and file permissions. You have to set these manually, which is pretty ridiculous.

Anyhow, I just recently switched to MAMP and it's much smoother. Everything is up to date, xdebug worked pretty much out of the box. No trouble with file permissions, and stuff is a lot more current. So, for now, avoid XAMPP on the Mac until they start supporting it properly. MAMP is good. XAMPP not so much.

13 July 2012

php.ini file include_path isn't showing new path

Just a very quick post that might help somebody stuck in the hell of having php.ini not recording your changes to the include_path. Here's some things to check.

1) shut off apache to edit the file.
2) make sure you have permission to edit the file. you might have to change permissions. check to see if you're writing to the file by checking the time the file was last updated.
3) if you've installed pear check to see if pear didn't add something to the php.ini file near the bottom. it's basically another include_path configuration. since there can only be one it will override the one at the top of the file. simply add your changes to the one configuration are and you should be good to go.
4) another thing to check is whether you can write to the file in another configuration option. just throw something down and restart apache and check it. if you can write to the file but just not see include_path then you have another include_path somewhere in the file that's overriding your settings.
5) the other obvious thing is to check to make sure the php.ini file is the one that's being loaded. do this by looking in the phpinfo() file. you can add this to a php file and run it in htdocs or wherever your root is, or in the case of xampp just run localhost and find the phpinfor() on the left bar.

hope this helps.

24 March 2012

Cheapest, most minimal, and best iPad case


My tip is simple. Go to the hardware store and ask for the small felt pads that are used on the inside of cupboard doors. They are very tough, have great adhesion and they will allow you to put the iPad down on most surfaces without worrying about scratching your baby. The bonus is that you can still have a naked iPad. If you're like me, I just slide mine into a laptop compartment of my knapsack when I go out with it.



06 March 2012

Best Way To Implement Basic Version Control While Keeping Important Files In Sync Between Computers

Dropbox
If you're like me and you are using many computers, and even different operating systems, then you will want to know how to keep your important files in sync and safely backed up to the cloud with version control. You can do this all completely free! My basic method is to use Dropbox and Sugarsync to do this, but I will also show you how to use a free cross platform program called Synkron to sync your important files to a USB key for times when you don't have an internet connection.

05 March 2012

How to Configure PHPStorm to Open Php Files in Your Browser in Localhost

How do you get PHPStorm to show your PHP files in your browser by clicking on the little browser icons in the right part of the window or right clicking and opening in your browser. PHPStorm doesn't just do this automatically. You have to configure it, and the configuration is entirely obvious. Here's what you have to do.

I'm assuming you have XAMPP or its equivalent installed and running on your machine. I'm also assuming you dumped your php files in the htdocs directory of XAMPP and that you can view your files in your browser just by typing the address using localhost/yourfile.php. And now you want to be able to open your files from within PHPStorm.