Tumblr Blog

Posted in Uncategorized at 7:32 pm by Toby

I’ve moved my occassional writing efforts to Tumblr http://www.tumblr.com/blog/imollusc


How fast does google add results?

Posted in Uncategorized at 6:30 pm by Toby

I asked a question on Stackoverflow.com today.

Within 13 Minutes it was in googles search results


Example of Creating a full contact with PhoneGap

Posted in Uncategorized at 5:49 pm by Toby

I was looking around for this example, so once I figured it out I thought I’d post it here for others.

It took me a while to figure out how to create a full contact for the IPhone using phonegap, as all the existing examples are very basic and give examples showing how to create a contact with a name and

Basically I found out that the input format is the same as the output format. Simply dump a contact to the console as a JSON string. Make sure it has all the fields you are interested in.

function find() {
// find all contacts with 'Mollusc' in any name field
var options = new ContactFindOptions();

options.multiple = false;
var fields = ["*"];
navigator.contacts.find(fields, onSuccess, onError, options);

function onSuccess(contacts) {

To create a contact you do the following.

function createContact(){

var myContact = navigator.contacts.create({"displayName":null,"name":{"givenName":"Intellectual","formatted":"Intellectual Mollusc","middleName":null,"familyName":"Mollusc","honorificPrefix":null,"honorificSuffix":null},"nickname":null,"phoneNumbers":[{"type":"other","value":"00353 2345235","id":0,"pref":false},{"type":"mobile","value":" ","id":1,"pref":false}],"emails":[{"type":"home","value":"work@intellectualmollusc.net","id":0,"pref":false}],"addresses":[{"postalCode":"","type":"work","id":0,"locality":"cork","pref":"false","streetAddress":" ","region":" ","country":"Ireland"}],"ims":null,"organizations":[{"name":"School","title":"Student","type":null,"pref":"false","department":"Kitchen"}],"birthday":null,"note":"YourRefUniqueID:47831","categories":null,"urls":[{"type":"other","value":"intellectualmollusc.net","id":0,"pref":false}]});
console.log("The contact, " + myContact.name.givenName + ", has been created");


Reasonably Straightforward.



Posted in Uncategorized at 6:54 pm by Toby

I use stackexchange / stackoverflow a whole lot, and recently found a cool site that someone had built with their API, called Stackgeography.com  It shows you where in the world people are asking questions on stackoverflow.com

Stackgeography Europe


Git My Site

Posted in Uncategorized at 7:29 am by Toby

I have  a number of legacy sites I look after that are old enough to have not been created with any CMS system like Drupal, Joomla or CodeIgnitor, just good old fashioned code.

I like source code control software, I’ve used

  • Copy and Paste (We all start here)
  • VSS (the most hideous thing ever)
  • CVS (briefly)
  • Subversion (never really liked it)
  • Component Software RCS (My first pleasant SCC experience, Brilliant, but now a bit outdated)
  • Perforce (an absolutely brilliant main SC system, still my favourite and main SC tool)
  • fossil(interesting but a bit weird),
  • Mercurial (very briefly as part of the brillian fogbugz) and most recently
  • git (Brilliant in its own special way, and particuarily in conjunction with github)
  • I even wrote a very basic source control system in a place I once worked.

However despite having experience with almost 10 differnt source code control systems, I still end up using the wonderful Editpadpro to simply connect via ftp to these sites and make a quick little change live on the server.  If I need to do anything major I do it with Source Control, but for 2 line changes or to fix a bug I often do it online/on-production , despite breaking the cardinal rule of software.  The obvious problem here is when I introduce a problem, if I don’t catch it immediately its sometimes a bit tricky to figure out what I broke.

Now I have a solution.

My host (Dreamhost.com) has git installed on some of its servers.  I have written a simple php script called gitmysite that allows basic sc interaction on the server.  This is read only externally, and is not designed to be pushed to.  It is basically a simple change repository.  Now when I make a change via ftp or editpadpro, I can simply go to http://www.mysite.com/gitmysite.php and after logging in write a quick commit message – click a button and I have a record of what I changed.  It will add all files I changed across the entire site.  This is still in development so it is a bit rough at the moment, but take a look at it on github and send me any feedback you might have.


With the script you can

  • Create a git repo
  • Create a .gitignore file
  • Add all files in your site to repo
  • Add changed files and provide commit messages after changes.
  • View Status
  • View Log
There are various things you cant do for vague security reasons such as do a diff and run arbitrary git commands.  There are certain things like merging and branching you cant do because it doesnt make any sense in the situation that gitmysite is designed to be used.


Tiny Todo

Posted in Uncategorized at 1:28 pm by Toby

Recently I was looking for a really simple ToDo program that worked online, that I could share between a few people to work more as a reminder than a real todo system.  Lots of these programs are far too complex.

I found myTinyTodo . It perfect for what I want, you can create new tabs for type of todo, there is a text box where you type your todo – hit return and it appears in your list, then click the checkbox and it dissappears.

If you need a simple Todo Manager, this one’s great.



Posted in Uncategorized at 11:07 pm by Toby

Links to pages I’d like to check out some other time.

Clone of facebook link to page code




Posted in Uncategorized at 1:40 am by Toby

I had an idea the other day, I thought ‘Why do we have to type all these 192.168.1.x addresses, it seems like a waste of time and a bit archaic.  Why can I name my machines and have a domain name for them.  Actually why cant everybody’.  Now they can.

Introducing ‘Anynework.net’

I have updated the DNS on anynetwork.net to have lots and lots of fully quaified domains pointing to IP addresses within the 192.168.1.x address space.


server1.anynetwork.net –



apple.anynetwork.net –


I’m in the process of writing an API so that you can get your app to request a subdomain to use for a specific ip address.

See Anynetwork.net for more details.

The only gotcha is if you’re disconnected from the net the names may not work.





Posted in Uncategorized at 1:52 am by Toby

I have recently discovered QRCode (stands for Quick Response Codes  but thats not really relevant).  These are two dimensional barcodes that can store a reasonable amount of data – up to several thousand characters, enough for a URL, Contact Info, a bit of text etc.  Recognition with a smartphone camera is trivial (taking a fraction of a second) and with Iphones and Android apps all sorts of cool things can be done.  I have now discovered that the quickest way by far to get contact details of a client onto my phone from our computer system is to scan a QRCode.  I now declare that I am going to use QRCodes for everything.

Here are two really good ways to generate QRCodes.

Zebra Crossing Barcode Generator (Using Googles Charts API)

PHP QRCode Generator (Pure PHP)

Both are really good, although for volume use the zxing / google one is probably better.  I chose to use the php library as I am using client data to generate contact cards in an internal app and wasnt completely happy about sending that info to Google over the web, even though they do say they only store it in Logs for a couple of weeks.  For non-sensitive data the google chart api is a brilliant way to generate qrcodes.  Just embed the details you need into the src attribute of an img tag on your page.

There are some very good QRCode Scanners for phones, the best I’ve found for the Iphone is Barcodes from the zxing people.


Opening up to the world

Posted in Programming, Sites at 12:28 pm by Toby

We have an internal php app that we use everyday. I wanted to make it available to our staff when they are out and about, but wanted to add a little extra security.  We now run on Apache after having run on IIS for years, so I reckoned a .htaccess file was the way to go, but I only wanted the user to be asked for an extra password if they were accessing it externally.

I asked a question on stackoverflow.com (which is for programming questions what google is for search), which lead me to the my answer on this site.

« Previous entries Next Page » Next Page »