If you’ve open the terminal and run the “svn” command just to be told “-bash: svn: command not found” then do the following:
1) Install XCode
2) Open “Preferences” and click the “Accounts tab”
3) Add your Apple ID
4) Open the “Downloads” tab
5) Click the download link next to “Command Line Tools”
6) You have SVN!
A handy snippet to share with anyone who needs access to the countries of the world (Australia/New Zealand at the top in my example) as a PHP list:
Continue reading “Countries of the world in PHP array”
If you’re getting an XML error when you’re using Facebook Connect to post to a users stream using the function:
Then ensure the following:
- You don’t have any double quotes in your attachment
- You don’t have any ampersands in your return URL
For some reason the content is being placed in a hidden field on the page on “mobile” devices. This isn’t escaping the contents of the post, and hence breaks if you have any of the above.
Highly frustrating! Hope this helps someone.
I couldn’t find a decent way online to convert ICS files into an Excel type format for easy manipulation, or adding to documents etc. So I’ve built a simple one that is now available online:
This takes an iCal URL and provides you with a CSV file as a download. Makes it much easier to get a list of dates from ICS files and use them for other purposes.
Also available is the CSV2SQL converter that I made last year, taking CSV files and coverting them into INSERT/UPDATE statements for use on a database.
So, you’re building a web based twitter client in PHP. Easy, just use a simple Twitter API client and call the Twitter API directly. But what if you don’t want to store the user’s Twitter authentication information anywhere? It’s a security risk anyway and some people don’t want to give up their account details to a 3rd party. So what to do? The solution is to use OAuth with Twitter. Continue reading “How To: PHP OAuth Twitter”
This is a simple process, however not something I could find documented anywhere easy to find. MAMP supplies you with a range of sample configuration files:
To setup one of these for MAMP, simply issue the following command:
sudo cp /Applications/MAMP/Library/share/mysql/my-choicehere.cnf /Applications/MAMP/Library/my.cnf
Recently I was involved in a podcast regarding the iPhone OS 3.0 upgrade. We looked at all the new features (and some upcoming ones in v3.1) and discussed how they relate to new features clients can develop in their apps.
You can hear more here:
What does iPhone OS 3.0 Mean for Your Apps (WSP Online)
So you’ve created a pretty Google Map on your website. You place a whole heap of markers on your map, driven from data you’ve got stored in your database.
A nice thing to do when we first show the map, would be to ensure that all the markers are visible on the map.
To do this, we need to set the zoom level and center point of the map dynamically. So how do we do this? The answer is GLatLngBounds():
// Get your locations from the database
var mapLocations = <? echo json_encode(Locations::Find()) ?>;
// Initialise our map, add some controls and a default center point
var map = new GMap2(document.getElementById("Mall_Map"));
map.setCenter(new GLatLng(15, 20), 2);
// Now the fun part - create a GLatLngBounds object
var bounds = new GLatLngBounds();
for (var i=0; i<mapLocations.length; i++)
var location = mapLocations[i];
var point = new GLatLng(location.Latitude, location.Longitude);
// createMarker() is a custom function which returns a marker for a given GLatLng
var marker = createMarker(point);
// extend our bounds to include this point
// add our marker
// Now dynamically set the center and zoom level for our map based on our bounds!
The key is the use of the line:
This uses our bounds (which we’ve dynamically extended to include each of our points) to determine what the center and bounds zoome level should be.
Fedora Core 5 is currently EOL – it’s not supported any more. As a result, you might find you can’t use yum to install packages any more – you get an error message about this file not existing:
This is because the repositories that yum uses aren’t there anymore. However you can modify the repositories in /etc/yum/repos.d/ and add these to fix the problem:
An example change would be to the /etc/yum/repos.d/fedora-core.repo file:
name=Fedora Core $releasever - $basearch
Okay, so sometimes our shiny friend and development support buddy MAMP won’t start properly. I’ve found this often happens when you’ve first booted up your Mac and you try to start getting stuck into your code.
Symptoms are pretty simple to diagnose – you start MAMP, and it’s control panel pops up and shows that everything is running:
But for some reason you can’t access your webserver or database:
What to do? Restarting the servers generally doesn’t solve the problem. However, there is a trick I’ve discovered. Open up the control panel and click the “Preferences…” button. Once this popups up, choose the “Ports” tab, change nothing – and click OK:
MAMP will automatically restart – and you should be up and running!