Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in /home/forge/masseltech.com/wp-includes/plugin.php on line 600
Apr 15 2010

Xcode Fix Recent Projects Empty

Terminal Command:
defaults write com.apple.Xcode NSRecentDocumentsLimit -int 10

Relaunch Xcode. Done.


Jan 20 2010

mysql command doesn’t work in OS X snow leopard

So you install mySql on your mac, and it’s working great, but then you go into terminal to run a mysqldump or something, and it doesn’t work!

you get a message something like:

-bash: mysqldump: command not found

so how do you fix this? well, copy and paste the following into your terminal window and press enter:

echo export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" >> ~/.profile

source ~/.profile

whoa, whoa, you say. what is this doing? It makes it so that when you type any command into the terminal, it does a check of these folders before giving you the “command not found” error.

If you want to undo it, you can always edit your .profile, or just delete it.


Jan 12 2010

WordPress on Snow Leopard: Unable to Connect to Database

If an “unable to connect to database” comes up while installing WordPress on a Snow Leopard machine, try adding :3306 to the end of the DB_HOST in wp-config.php

Assuming everything else works, this should solve your problem!


Aug 13 2009

VirtualHostX and mod_rewrite

To enable mod_rewrite manually, see: OS X server tips but if you are using VirtualHostX it changes your default config file. Add the following code to the Directives box:


Options FollowSymLinks
AllowOverride All AuthConfig
Order deny,allow
Deny from all

if you’re using the new version of VirtualHostX, make sure that you select Directory from the dropdown, then use:


Options FollowSymLinks
AllowOverride All AuthConfig


Jun 8 2009

Jealousy

picture-1


Mar 16 2009

How to do multiple virtual hosts on OS X

  1. Download and install VirtualHostX (don’t forget to back up your existing config!!)
  2. Download and install Gas Mask (manages multiple hosts files, dumb name though)
  3. If you want to do this with WordPress and you have a database locally and another one on a dev server somewhere, you can do the following code:

if(eregi(“^mywebsitename.com$”, $_SERVER[HTTP_HOST]))

{

define(‘DB_NAME’, ‘dbremotename’);

/** MySQL database username */

define(‘DB_USER’, ‘dbremoteuser’);

/** MySQL database password */

define(‘DB_PASSWORD’, ‘dbremotepassword’);

/** MySQL hostname */

define(‘DB_HOST’, ‘dbremotehost’);

define(‘WP_SITEURL’, ‘http://mywebsitename.com’);

define(‘WP_HOME’, ‘http://mywebsitename.com’);

}

else{

define(‘DB_NAME’, ‘dbremotename’);

/** MySQL database username */

define(‘DB_USER’, ‘dblocaluser’);

/** MySQL database password */

define(‘DB_PASSWORD’, ‘dblocalpassword’);

/** MySQL hostname */

define(‘DB_HOST’, ‘dblocalhost’);

define(‘WP_SITEURL’, ‘http://mywebsitename.com’);

define(‘WP_HOME’, ‘http://mywebsitename.com’);

}


Mar 16 2009

HTML Special Characters

Any good web designer knows certain characters have to be encoded in HTML.

Here’s a list of pretty much every character and it’s encoding: http://webdesign.about.com/library/bl_htmlcodes.htm

Bonus: Need to use some encoded characters in your PHP script? Use html_entity_decode() to turn them into regular text.


Mar 16 2009

OS X Server Tips

To enable PHP:

  • nano /etc/apache2/httpd.conf
  • uncomment LoadModule php5_module…

To enable mod_rewrite

  • In the primary site configuration, change AllowOverride to AllowOverride All AuthConfig
  • Restart apache with sudo apachectl restart