Here it is.

Coding, Humans and where it all goes wrong.

Divvy

Divvy Logo
Divvy

I recently came across divvy, on proggit. A week after being posted divvy put up a 2nd post, showing very honestly and openly, sales and conversion figures before and after the reddit effect. You can find it here.

Liking their openness and honesty I gave the app a try and I loved it. To it’s credit it’s very simple, but I won’t bother to describe the app in words when a quick video can do the job. Divvy Intro. To be honest your best bet is to demo it and see if it works for you.

The app is simple, almost a little too simple to be worth the price($14 or $9.80 with a voucher).I have purchased it, but with hope the developers will add some interesting things in the future. It is neat, tidy and complete as it is however.

Oh and if you missed it on the reddit link, the coupon code WeHeartReddit will give you 30% off.

Painless website monitoring

I have a ton of websites I need to keep my eye on, in case the server dies or mysql dies or apache dies or any of the other millions things that can go wrong.

I tried pingdom and it’s certainly the business but the free accounts only allow for one domain and I didn’t really need most of the features.

I then came across specto, it rocks! From the site “Specto is a desktop application that will watch configurable events (such as website updates, emails, file and folder changes, system processes, etc) and then trigger notifications.” It’s a ubuntu app(in the repos) and the process for adding sites couldn’t be simpler.

Add a webpage
Add a webpage
Fire an event that pops-up firefox with the url
Fire an event that pops-up firefox with the url

Cheap webapps

3 of the web-apps I covered on top ten webapps for programmers are available in a bundle on https://www.appsumo.com/ (a Macheist for webapps it seems).

As I already have pro accounts for Evernote, RTM and Mindmeister I asked if I could pay and have them renewed for a year on top of my existing subscription. Seems I can for Evernote and Mindmeister but not RTM.

Giving up on wikis

Why bother with wikis

MySQL - Tech Wiki

For a while now I’ve been using wikis to store all my quick/slow solutions to problems I’d come across throughout my day. This would range from say ‘What’s the syntax to create and grant a user all access to a specific table in mysql?” to “How can I svn add all unversioned files in a directory?”.

Wikis have served me reasonably well over the last few years. Originally I started with mediawiki, which was horrendously slow on my dreamhost server, I switched to wikkawiki as it was lighter and had in-build code highlighting(which lead me to believe it was more developer-oriented). It took me a while to convert from mediawiki formatting to wikka but I persevered. Soon after I realised that wikka didn’t support tables of contents(which drove me insane!) and lead me on a search for an alternative.

wikka-screenshotIt could have been the lack of a table of contents in wikka but I think in general wikis aren’t structure well for the sort of information I store and retrieve. Typically my day involves a lot of problems and solutions, the end goal of the wiki was to ensure that the next time I was faced with the same(or similar) problem I could retrieve my prior knowledge on my wiki. This was instead of searching the web for that random one line of text from that forum I read 4 years ago that is the silver bullet for my immediate problem. Towards the end of using wikis, searching for that random line of text proved easier than traversing wikis.

Why wiki’s suck

I realised the reason I hated using the wiki was:
a) The wiki was storing the solution only
and
b) structure that I thought was holding everything together just sucked.

To explain both a and b lets take one of my original example questions.

‘What’s the syntax to create and grant a user all access to a specific table in mysql?’
Let’s start with how I would likely retrieve this.

I start searching for ‘mysql create user’ and fail to find anything, because (a) I wasn’t storing anything that related to my problem, just the solution.

Then I would start browsing through my mysql page on wikka desperately looking for something that would relate to my problem. The page is massive and I’d get a ton of crap I didn’t want, which is where (b) comes in. I’d then give up and google a solution.

The answer is in fact “GRANT all PRIVILEGES on table.* to user@'localhost' identified BY 'PASSWORD';“, hence why my search failed, there was no create in the command.

The solution

So I started looking for a solution, basically a question and answer type site that would suit my information storage/retrieval. I really didn’t want a forum(ugh phpbb). I had something similar to stackoverflow in my head but I didn’t have/want to splash the cash for a stack-exchange site just for my own private data. I eventually came across osqa, which is a clone of stack overflow built using python. It’s turned out to be the perfect solution. There was an incredibly handy guide for installing it on dreamhost. Soon after I started using it full-time for work/personal use. When I’d solve a problem, I fully formulate a question then paste/fill in the solution I’ve come across. If I come across a better solution it’s added as another problem to the original answer. I vote up any answers I use so the most frequently used/best solutions are ranked higher. Data is organised using tags and that’s it really.
osqa-homeIt’s certainly changed how I work, it’s become addictive adding my q & a’s. As opposed to the wiki it really feels like I’m filling in a personal knowledge repository. On top of that it’s added a sort of period of reflection after every new problem I solve. As I’m filling out my problem/solution I start thinking more about what I’ve just solved, is there better solutions, can I use this solution anywhere else? I’m also reminded more of what I do everyday, in a sense it’s become like a journal.

Sure I could store my problems and solutions in mediawiki, but on those busy days I might just slip up and not bother putting in a question or just paste in the solution(without any explanation) as I was doing before and I’d rather not store a solution at all if it doesn’t come with the problem. A better structured wiki might also solve the problem, but the question arises ‘Why bother with maintaining unstructured data when you don’t need it’s flexibility?’.

Google History told me I’m a nerd

24000 searches later and here is my top ten sites I click to on google.

Top sites
1. http://ubuntuforums.org
2. http://en.wikipedia.org
3. http://www.boards.ie
4. http://stackoverflow.com
5. http://lifehacker.com
6. http://php.net
7. http://drupal.org
8. http://www.php.net
9. http://wiki.archlinux.org
10. http://addons.mozilla.org

Yep most of them are nerdy related but I was utterly shocked that ubuntuforums.org bested wikipedia. So I have more interest in a flavour of linux than I do on…. the rest of life, basically.

Terrific.

Teach Yourself * In 21 days!

The sooner they stop wasting bookstore shelf-space the better!

teach-yourself

8 randomly useful php tricks

In keeping with my series of 8’s.

1 ) debug_print_backtrace() - I use this one a lot, print a debug-style list of what was called to get the the point where this function is called. Very, very useful.

2 ) __autoload() – Called when you attempt to load a class that hasn’t been defined. Example: I try load class xyz, the class has never been imported, I use the autoloader to attempt an import of xyz.php. Probably not the best technique for readability or clarity in code, but has it uses.

3 ) ip2long() - Don’t store IP addresses as strings on a db use this to store them as a long.

4) __toString() – If an object is ever used as a string, you can define what’s returned here. Again you can find it’s uses once you realise these things are possible. :)

5) get_browser() – Easily get your hands on the users browser-type. Some leave this process to the browser end but can be useful to get this info server side.

6) More of a total dirty hack(come on, it’s PHP). Having problems with that annoying ‘headers already sent’ error. Don’t bother to fix the underlying problem, just omit the closing php tag! It’s totally valid(this list is really becoming things I hate about PHP….)

7) natsort() – This will sort lists of things in ways humans will understand. Good idea when displaying drop-down lists etc for users. Again, you might find a use. :)

8) metaphone() – Again one of those random things PHP does, you may never use this but this will return how a word sounds. EX: Bomb->BM. Might be useful for comparing words that sounds similar, this one’s really obscure and I honestly haven’t actually found a use for it yet. :)

Take a look at the PHP magic methods for some other ideas. :)

Top 8 Vim Plugins

vim-plugins-surround-vimWhy 8? Because after much tidying I figured out there’s 8 I only use. :)

1 ) CheckSyntax – Check the syntax of the current file. Handy it automatically runs on save.

2 ) SearchComplete – Type part of a variable name, press tab and it will auto-complete the name.

3 ) MatchIt – Extends % with more than going to the matching brace.

4 ) Project – Allow managing of source folders, sorta like an IDE.

5 ) Surround – Delete, change and add surrounds(XML tags, bracket, quotes etc) with ease.

6 ) TagList – Using exuberant ctags it provides an overview of your source code structure.

7 ) SuperTab – Provides better tab completion.

8 ) Get Latest Plugins – Possibly the handiest of them all, :GetLatestVimScripts and all yours scripts are up to date(after some configuration).

Top 10 webapps for programmers

1 ) Evernote Evernote_Icon_256


Although I use evernote as my brain online for everthing, it is incredibly useful for programmers too. Where I work things like requirements can be captured on almost anything, so snapping photos of whiteboards/notepads/beer mats that become OCR searchable is very handy. On top of that it’s nice to have all notes auto stored up on the web(I’d have a fit if I lost my developer diary over a hard drive crash). The client application for evernote could be better and I’d consider Microsoft’s OneNote a much better application but Evernote does everything I need it too. The killer feature being the iPhone app that lets me capture text, voice and snapshots everywhere. Coupled with JotNot it gives me a very powerful information capturing device that I simply cannot live without. This is one of the truly killer apps for my iPhone.

dropbox-icon2 ) Dropbox

Why does my hard-drive always die the evening I forget to push my code up to the git server? Store all code/config files/documents up on a server always. The benefits are stupidly obvious. It’s soon after this realise you can start adding free little tricks that you didn’t think possible. See my previous example for why dropbox rocks for vim/linux users. Another plus, I don’t have a static ip with my broadband at home(dyndns doesn’t work due to my isp’s infrastructure, a massive mesh NAT) so here’s a cool trick for easily torrenting(or in my case usenetting) files remotely. There’s also something very nice about being all to pull up any of my important files anywhere there’s a web browser.

gmail3 ) Gmail

Yes it rocks, despite Buzz.. Filters, label and keyboard shortcuts have made this such an obvious choice it’s not even funny. I’d almost forgotten to add Gmail to the list it’s become such an integrated part of my web-use. The programmer related benefits are dissimilar to general user benefits, but thing extended features like keyboard shortcuts etc I probably only of real benefit to the techies who are the only ones bothered to read up on these features. Other than that there’s little to say, odds are I’d mostly be preaching to the converted anyway.

stackoverflow_glossy_14 ) Stackoverflow

Not exactly a web-app but something most programmers cannot live without and it’s web-based. Arguably this could be number one , but personally I don’t use this resource as much as the above three. Have a programming question, odds are insanely high it’ll be answered here.

google-reader-logo2

5 ) Google Reader

We’ve all got to keep up with the lastest developments in our industry. This is simply the easiest way to do it. Some good subscriptions: Coding Horror, A list apart, trivium, proggit and Bertrand Meyer’s blog. Also reader has a new feature that supports updates on sites that don’t actually support RSS(some might question the point in RSS with features like this….). This feature’s very handy for one of my favorite programmer sites.

mindmeister6 ) Mindmeister

I use a hell of a lot of mindmaps for storing programming related knowledge. Almost every technical book I read has mindmaps associated. I like building mindmaps, it forces me to have a 2nd thought on the content I’m reading and I have a less painless way of reviewing what I’ve read. To be honest, mindmeister as an application isn’t perfect. It doesn’t have folders or any decently readable way of labelling mindmaps. Very annoying when you’ve got tons of mindmaps to sort through. I’d love to say that the fairly expensive iPhone app makes up for this(not sure why it couldn’t be free considering it’s a subscription based service), but the app for me is almost worthless. There’s nothing wrong with the app in itself it’s just not a pleasant experience browsing/editing mindmaps on your iPhone. It seems like I’m singing the praises of mindmaps over mindmeister itself but other than these few issues mindmeister is a solid application. As it’s online sharing mindmaps is also a very handy feature. See here and here for examples of how I’ve used mindmeister. But if sharing/accessibilty anywhere doesn’t matter to you I’d recommend something like FreeMind for all your mindmapping needs, even keeping your local mindmaps synced on Dropbox could suit you just fine.

p-42b9e7e9be3e48c59d15b6cada841494-large-10007 ) Pinboard

Pinboard is a very nice online bookmark storage. Very, very simple bookmarking/to-read lists, fantastically simple tagging features and the ability to add bookmarks from emails makes this a great service. I keep all my tech articles up on this service. For an extra charge all my bookmarks become archived, meaning if I bookmark a site using pinboard and the site in question goes down the page is still accessible from pinboard forever. I could do the same using archive.org but having this feature included in a bookmarking service really makes sense. On top of that adding bookmarks from google reader, twitter, instapaper and delicious really adds to the service. Highly recommended bookmarking service for techies.

remember_the_milk_icon8 ) Rememberthemilk

Remember the milk takes the simple idea of todos lists, adds a set of complex features(due dates, repeating tasks, tagging, folders, sharing and a lot more). Adds in the ability to add tasks from almost anywhere. IM, email, phone(if supported), widgets for almost anything(including gmail), and many apps that support it(tasque/gnome do for linux or a dashboard widget for osx) and you’ve got RTM. Yet the application itself never gets bogged down in it’s complexity. ‘Buy milk today’ or ‘Buy milk tueday’ or ‘Buy milk tue’ or the many other variants of dates and rtm will likely be able to parse a date out of it. Other nice little tweaks like this makes RTM a great application for the programmer, as I mentioned in books like Passionate and Pragmatic Programmer Programmer there’s a lot of  ’Act On It’s’ some of them have different contexts, for example I might need to do a task weekly at home or do a task everyday in work. Using RTM to handle the adding of all these tasks makes things a lot easier. I also use the pomodoro technique with RTM, using the tagging features I add estimates to my todos (e1,e2,e3) via tags. On top of all the other programming related todos I intend to do(including this post!) this service has made life a lot easier.

grooveshark9 ) Grooveshark

It’s up for debate whether programmers should listen to music at work or not. Personally I find music listening to music fine when I actually have to code, but when it comes to creating a specification or stepping through code listening to music is a very annoying distraction. When I do listening to music I always use grooveshark. The UI leaves a lot to be desired but there’s a music selection that’s 2nd to none, the playlists are handy too depending on the mood you in. Feeling tired in the morning? I have a wake-up playlist. Need some background music, there’s a playlist for that! All very painless.

nsm10 ) NutshellMail

NutshellMail is a service that combines twitter, facebook, linkedin and myspace updates into a single email that’s sent to you on a daily basis. I questioned whether I’d use this service when signed up but I’ve come to love this application. I follow a lot of developers on twitter and some through facebook and it’s really nice to know your updates will arrive at a certain time everyday. Instead of jumping on every few hours, negatively impacting on my productivity, I have a focused time to get myself updated on all the latest trends. The linkedin support is handy too for keeping up to date on your professional news also. I could have added twitter/linkedin to this top ten but at this stage I think these websites go without saying(and they’re not exactly web applications in the obvious sense).

Sync config files over dropbox

dropbox-iconOne of the many reasons for my love of linux is the idea of keeping config information in simple texts files in the home directory of each user. It all very painless. And now with Dropbox I can have a set of application configurations stored via the web.

Using Dropbox, add a folder(I’ve called mine dotfiles) and add in all the useful config files you have.

For me it’s my

.bashrc (sets up environment stuff, can be iffy with multiple machines however)

.bash_aliases (sets up all my command line aliases)

.vimrc (my vim configuration)

.vim/ (my vim plugins and documentation)

.muttrc (my mutt config)

.screenrc (my screen config)

.irssi (my irssi config)

Move all the files you wish to sync with Dropbox into your dotfiles(or equivalent) folder then simply:

1) cd ~

2) ln -s /home/username/Dropbox/dotfiles/.bashrc

And bingo! Your bashrc files is now synced over Dropbox. Any changes you make on your current machine will be propagated over all machines use this Dropbox config and visa-versa. On top of that the prospect of maintaining profiles over multiple machines become a lot less painful. Even setting up a new machine is handy. Setup your os, download dropbox, execute ln -s a few times and you’re done, and this can be extended to any application that supports these plain-text config files. It’s really awesome!