Maybe Useful

Some things I’ve collected over time

Upgrading to Mac OS X Mavericks Breaks Apache

I decided to upgrade to Mavericks today. Things went pretty smooth, right up until trying to continue work. I don’t use Vagrant or MAMP, but rather the built in Apache2 (with PHP, etc installed via Homebrew).

My VirtualHosts in /etc/apache2/extra/httpd-vhosts.conf were kept, but going to http://localhost/ took me to the default “It Works!” page. I quickly discovered that the httpd.conf file was reset. Stuff I had to do to fix it below.

Git Terminal Tricks

I develop on Mac OS X and do my Git stuff in Terminal but I often found myself cursing at two things:

  • Doing git status or git branch just to know which branch was active
  • Doing git checkout dTab in the hopes of getting git checkout develop

This might be horribly obvious to some people and don’t ask me why, but only after months of cursing at this, I decided to Google these two things and make my Git life easier.

Symfony: Doing Composer Update With Symlinked Assets

$ composer update
Installing assets using the hard copy option

Ugh fuck. Now I have to make sure I don’t forget app/console assets:install --symlink, or I’m gonna be cursing next time I’m adjusting CSS and I don’t see my changes happening, because I forgot they’re no longer symlinked.

Symfony: Absolute Asset URLs in Twig Templates

As with many applications, mine sends several e-mails. Some are sent instantaneously, some are sent from the spool. Whatever the case may be, you need absolute urls to links and assets. As an alternative to path(), Symfony provides the url() function for Twig, which creates an absolute url for a certain path. However, there’s no alternative for asset(). The only solutions so far I’ve seen, required prepending asset() with or something similar.