I’ve switched this site and the others that I host over to running on a Dreamhost VPS. After some tinkering with settings and caching, I’ve got the site running much faster and more securely. If you notice any problems either leave a comment or contact me.
Keeping development environments in sync between two locations can be challenging. One solution might be to switch to a cloud-based environment using DropBox. Netbeans is an IDE that works very well, as it has ftp/sftp support and git/svn integration. Netbeans is also a java based program so it lends itself to being launched without the need to be installed first. XAMPP is an all-in-one web server for use on standard workstation machines.
The first step is installing DropBox, using the preceding link will give you an extra 250 MB of storage bringing the total to 2.25 GB of storage 1. The extra storage will come in handy. When installing make sure to choose a path that will be the same on all computers, C:\Dropbox is recommended, the location can be changed later in the Dropbox options. The next step will be installing Netbeans, all the recommended settings will work fine, the files will be copied later anyway. Now download XAMPP files, grab a copy of the zip file instead of the installer it will make it easier to choose the location. After all this is ready now time to start setting up the environment.
To help keep everything organized, create a sub-folder in the C:\Dropbox folder to hold all the development files.
- Extract the XAMPP files to your Dropbox sub folder, don’t rename the XAMPP folder. Now you can just run the setup_xampp.bat file in the XAMPP directory and it should find all the paths correctly. Another option is to XAMPPlite it uses relative paths so might lend itself better to if the Dropbox folders can’t be in the same location.
- Navigate to the Netbeans folder, it is located at c:\Program Files\Netbeans X.X (or Program Files(x86)for 64bit OSes) where X.X is the version you’ve installed. Copy the whole Netbeans X.X folder into the Dropbox sub folder created earlier.
- Now move the java files necessary for Netbeans to run unless java is already installed on all the computers using the development environment. The latest version can be downloaded from here. If java isn’t installed on all computers can simply include it in the Dropbox as well. To do this navigate to C:\Program Files\Java (or Program Files(x86) for 64 bit) and copy the jre6 folder into the Dropbox sub folder.
- Since Netbeans stores its configuration in the user profile it will be necessary to change this. Create a “NetbeansUserDir” folder in the Dropbox sub folder. Now in the Netbeans X.X folder edit the etc/netbeans.conf. Find the line
netbeans_default_userdir=and make it say
netbeans_default_userdir="..\..\NetbeansUserDir"Then if java was included in Dropbox, find
netbeans_jdkome=farther down in the file and change it to read
netbeans_jdkhome="..\..\jre6"These are relative paths so they might change depending on how the sub folders arranged.
Now navigate to the Netbeans X.X/bin folder and launch netbeans.exe. All shortcuts can now be replaced with a link to this file instead of the one in Program Files.
One other thing that I personally ran into was I’ve got a smaller primary drive and I’ve got the paid edition of Dropbox and moving it to the primary drive would have filled this drive up. The solution was to use a symbolic link. This is similar to a shortcut but the paths do not change which is needed for XAMPP to work right. You will need to open and command prompt and use this command:
mklink /D C:\Dropbox F:\Dropbox where F:\Dropbox was the current location for my Dropbox folder.
1) The extra storage will be available after installing the desktop client software.
Following on the idea from this post, sometimes a full-blown Twitter plugin is too much. Luckily Twitter has a rich API that is ripe for the taking of information. The API console is of great use to find how to properly format the API requests. This code below will output the number of followers specified by the username passed to the function wrapped in a link to the page that allows the visitor to easily follow the user.
Sometimes a Twitter plugin is just the right fit for a site, other times it just might be overkill. If all that’s need is a simple list of recent Twitter posts this solution might be the best. The code below can be placed in a functions.php for the current theme or in a separate plugin. The code will automatically change @usernames into links to profiles and #hastags into links for the search page for the tag. It will also convert text links into valid click-able links.
Another new addition to 3.4 is the deprecation of the get_theme_data function, this function was used pull data from the header of a theme’s stylesheet. This function was useful for outputting theme data in a repeatable way. The new function wp_get_theme is the replacement for this function. The difference is that the get_theme_data returned data in an array and the data was accessible via array keys, while wp_get_theme returns the data as an object. This has little effect on how the code is used just how to retrieve the data.
Maintaining backwards compatibility is always a top priority when releasing a theme for the public. This code below will accomplish this by testing if the new function exists before running it, and falling back to the old function if it doesn’t. The same variables are used for either way, so they variables can be used regardless of what function is used.