Web Development by Alistair Robinson

« Blog home

Archive for December, 2009…

FoxyCart: Replacing A Cart Item


December 14th, 2009 1 Comment

function add_pre_process() {
  //Find the id of the existing registration in the cart, if it does exist
  $.each(fc_json.products, function(key, product) {
    if(product.name=="Registration") {
      // Do the remove request, with parameter quantity=0
      $.ajax({
        async: false,
        type: "GET",
        url: "https://mydomain.foxycart.com/cart?output=json&cart=update&id="+product.id+"&quantity=0&callback=?" + fc_AddSession(),
        dataType: ‘json’
      });
    }
  });

  // Add the new one
  add_item();
}

function add_item() {
  //Get the form data
  var submitted_data = $("#signup").serialize();

  //Do the add request
  $.ajax({
    type: "GET",
    url: "https://mydomain.foxycart.com/cart?"+submitted_data+"&callback=?" + fc_AddSession(),
    dataType: ‘json’
  });
}
This javascript/jQuery code gets the contents of your cart (which is in the variable fc_json, made available by foxycart_includes.js), removes any item whose … read on »

Web Development Frameworks: Developing For vs. Developing With


December 10th, 2009 4 Comments

I’ve been hunting for a web development framework for a few months. Back in the summer I was immersed in CSS and javascript, just sticking with my tried and tested server-side techniques. Using the TinyButStrong (TBS) template class I could put together a highly organized dynamic website pretty quickly. In retrospect it seems that I’d found my own path towards an MVC-like pattern: nothing but HTML and logic-less TBS tags in the templates; PHP pages acting like controllers, for form processing and manipulating data; and a class for each table in the database (more or less). Very neat. Framework junkies amongst you could tell me exactly why this isn’t really MVC, but I don’t care.
Anyway, my first intention was to … read on »

I Undressed Her by Mistake


December 4th, 2009 No Comments

Freud’s Psychopathology of Everyday Life reads a lot like today’s popular science books. In particular it reminds me of Musicophilia by Oliver Sacks, with its conversational style.
Much of the pleasure is the spectacle of all these Viennese doctors revelling in the exciting new theories of psychoanalysis, sharing their little anecdotes. Writing about inadvertent actions and how they can reveal unconscious motives, he quotes another psychologist:
“I entered someone’s home, and gave the lady of the house my right hand. Oddly enough, in the process I untied the bow holding her loose morning dress together. I was not aware of any dishonourable intentions, yet I had performed this unskilful movement with a conjuror’s sleight of hand.”

Chemicals and Complexes


December 3rd, 2009 No Comments

As I wrote in the last post, I’m a tangle of complexes. Why didn’t I know this before? Lately I’ve been examining how my own self-awareness has changed over the years. I suppose you could call this self-awareness-awareness.
For years I would sometimes have bad moods of a particular kind, and during those moods my thoughts would turn to violence. Sometimes while walking in town on my way to or from work I would slip into a self-righteous rage, but lacking a very good reason for it I would fantasize about people offending me more than anyone in fact was doing, and about what I would do to them if this happened (normally involving a beating of some kind, but nothing … read on »

Web Development and Chopping Garlic


December 2nd, 2009 1 Comment

For this post it was a toss-up between:
1. My observations on Freud’s Psychopathology of Everyday Life (boiling down to my realization that I’m a tangle of complexes, but also that I’m actually doing alright and won’t be running to an analyst any time soon)
2. A vague and geeky ramble over the broken, scarred and unstable terrain of web development.
Since moving this blog over to my website, I’m conscious I may be losing those who enjoyed such posts as Sweaty Rectangle and My 25-year-old Earworm, but the geeky ramble won out this time. Bear with me though: I am large, I contain multitudes.
Though I’ve been doing web development off and on for ten years, I’ve never been as enthusiastic about it … read on »


©2010 Alistair Robinson