Tidy JSON for PHP

I wrote a simple PHP utility that will convert ugly, convoluted JSON into a nicer, standard format. It doesn’t perform any validation and is not optimized whatsoever – but maybe it’s just what you’re looking for. You can find it over on github: Tidy JSON.

Usage:

<?php

require 'tidyjson.php';

$json = '{"foo":"bar","baz":[1,2,5]}';
$tidy = TidyJSON::tidy($json);

?>

Growl Notification for Subversion

I’ve written a little shell script that can be used to poll a Subversion repository and notify you via Growl when new revisions are added.

To start using it, download svn-growlnotify from github, copy svn-growlnotify.sh somewhere so you don’t lose it, make sure it is executable (chmod +x svn-growlnotify.sh), and set up a crontab entry to run it with your repository URL:

* * * * * /path/to/svn-growlnotify.sh -s http://your.repository.url/ 1>/dev/null 2>&1

Here’s the source code:

Croppy, a simple Windows screenshot utility

I’ve recently started using Croppy, a simple Windows screenshot utility. It works perfectly for quickly sharing images with friends and colleagues – launch the app, resize the transparent crop window, and click “upload to web”. An image of whatever you were looking at is uploaded and a URL copied to your clipboard. Very similar in function to the Mac-based Skitch software – but much more lightweight.

Subversion with LDAP on Windows Vista

At 2Advanced we are using Subversion to manage project files, using LDAP for authentication on our Windows domain and Exchange server.

This system works very well, but when we switched to Windows Vista we started having intermittent issues on various workstations. TortoiseSVN, our svn client of choice, will occasionally fail with an “Unauthorized” error or other similar error message when doing a commit. We noticed that this normally happens during a longer commit, and TortoiseSVN will usually re-prompt for a username/password partway through the commit before failing. I’m not sure why, but sometimes Tortoise will use the Windows user’s credentials to access the repository, but sometimes it will prompt you to enter a username/password. In order to avoid getting the error message, you need to ensure that, if you are prompted to re-enter your username/password, you use the exact same string (matching case) that was used initially. If the strings dont’ match exactly, the commit will fail because it thinks two separate authors are sending the same commit.

I’m mostly posting this for my own reference because I keep forgetting exactly what’s causing this strange problem.

Another key when setting up SVN with LDAP on a Windows domain is to create a group for each user – including all possible permutations of that user’s username

username = DOMAIN\Username, DOMAIN\\Username, Username, DOMAIN\username, DOMAIN\\username, username

MyGroup = @username, @otherusername

[/MyClient/MyProject]
@MyGroup = rw
* =

FavTwits, a Twitter tool

FavTwits is a tool I just wrote that explores your relationships with other Twitter users through your and their use of @username tweets. Find out who you are tweeting with the most, and plot the results on a weekly activity chart.

Comments, suggestions? Let me know. Want to help me out w/ a decent design? Go for it!