Using lrnja.net Custom URL Shortener with Bit.ly

I’m a big bit.ly fan and recently I registered a shorter URL to use for short links – and I went for lrnja.net. I sat down to configure my new domain with bit.ly, and it was very straightforward (I’d almost say “designer-proof”! /me ducks).

  • First: register your domain
  • Log in to your registrar’s control panel and add an A record*
  • That’s it! In about 24 hours, you’ll be able to shorten with your domain

* or a CNAME if you want to use a subdomain of an existing domain.

Bit.ly has excellent instructions here: lrnja.net/bitlydomain

The Tree Command

Today I’m working on a little tutorial (about writing RESTful services, for this site) and I used the tree command to illustrate the file and directory layout of the project. I love this little command and use it frequently, but it isn’t very well known so here’s a quick example. Continue reading

Tracking Your Domain with Bit.ly

As a blogger and lover of graphs, I am not sure how I hadn’t already seen bit.ly’s tracking domain feature. With this, you can register a domain and see reports on all of the URLs that are shortened with bit.ly which point through to that domain.

Continue reading

Inner vs Outer Joins on a Many-To-Many Relationship

Someone will probably tell me that this is an elementary-level topic, but I got some good questions regarding joins from my most recent ZCE class students, so I thought I’d put down the examples that I used to explain this to them. Being able to join with confidence is a key skill, because it means that you can refactor and normalise your data, without worrying about how hard something will be to retrieve.
Continue reading

Simple Regular Expressions by Example

Whenever I ask a group of developers if they are familiar with regular expressions, I seem to get at least half the responses along the lines of “I’ve used them, but I don’t like them”. Call me a geek if you like, but I quite like regex; I think often it seems unfriendly because it’s used inappropriately or just thrown into code with “here be dragons” type comments rather than documentation about what should match, and what shouldn’t!

As with most things, it’s pretty easy when you know how, so here’s my one-step-at-a-time approach to regex (stolen from my ZCE preparation tutorial slides). Let’s begin at the very beginning: regular expressions have delimiters, usually a slash character, and these contain a pattern that describes a string.

pattern notes
/b[aeiou]t/ Matches “bat”, “bet”, “bit”, “bot” and “but”
Also matches “cricket bat”, “bitter lemon”

Continue reading

Is This Marketing?

Last year, someone asked me what I’d chosen for the company Christmas cards (I was relatively newly self-employed at the time). The idea of company Christmas cards had not even crossed my mind, but that conversation stayed with me and this winter, I picked a photo I took last winter, and uploaded it to moo.com, producing this:

DSCF5647.JPG

Continue reading

Importing and Exporting MongoDB Databases

I’m enjoying working with MongoDB but as with any new technology, it can take a little while to find your way around all the tools related to that stack. In particular, I found myself wondering how do I mysqldump for mongodb?

It should have come as no surprise that the command I wanted was called mongodump, really! Continue reading

Do-it-Yourself Peer Review

When I get asked about tools for quality assurance, I will pretty much always mention that the technology is not the answer. In my experience, the best improvements in quality come from process, from letting as many people as possible have access to all aspects of the system as early and often as possible (this is exactly why evolving projects “release early, release often”). A great tactic is to have another developer review each change – but what do you do if, like me, you work alone? Continue reading

Explaining MySQL’s EXPLAIN

The MySQL explain plan is a great tool to help developers and database administrators to improve the performance of specific queries happening against a database. It is very easy to use, but its output can be confusing, so I thought I’d show a very simple example. Continue reading