Posts Tagged ‘coding’

Gluttons for punishment

Sunday, June 27th, 2010

There was a really interesting poll on SitePoint today asking whether freelance web developers were working this weekend. The results were as follows:

  • 43% said they always worked weekends
  • 34% said they sometimes worked weekends
  • 20% said they worked weekends if necessary
  • Only 3% said they never worked weekends

What we can probably assume from this is that on any given weekend, more than half of people who do freelance web development are working. Crazy people. Anyway, I would love to chat more about this but I have code to write…

Calling the Brain Trust

Monday, May 31st, 2010

Ok, here is the situation. I have a website which has two virtual hostnames pointed at it – domaim.com and sub.domain.com. They both point to the exact same location in the file system and serve the same content. However I need one of them to invoke a http authentication and the other not to.

The obvious solutions I see are…

Set up a rule in the .htaccess so it only requires a valid user when accessing the sub domain. This is the simplest solution but I don’t think such a rule exists.

Dynamically serve different .htaccess files based on the host being accessed. This ticks neither box of being simple or actually something you can actually make the computer do. But maybe it is if you start layering your .htaccess files.

Invoke the http authentication from the PHP script itself, detecting the server name and serving if appropriate. This is doable and straight forward to implement but requires quite a bit of coding.

Also maybe I can do the original solution, but only inside the vhosts.conf file? I haven’t really looked into that so that’s just speculation. Question is, which is the easiest solution to implement?

Dinner and ‘lancing

Sunday, June 28th, 2009

Wednesday I headed over to my parents for dinner for what I thought would be a relatively easy eveningf with plenty of time to sort out my room when I got back home.

As is turns out the NHS had just dumped a load of work suddenly on my previous job, Open Door Design so I ended up heading over there to give Nick a hand ith it. It was relatively simple stuff to take care of though it was going on 10 when I left there so by the time I got home I didn’t have much time to sort my room out. I have since thankfully so I’m no longer living in a cave of boxes which is nice.

ASP dictionary fun

Thursday, May 7th, 2009

ASP has a lot of “interesting” features shall we say. I’ve just been working with the dictionary object which is basically an array with named items, so everything has a key and value pair.

There is a method to add elements to it which accepts variables instead of literal text strings (as you would expect of course) but it doesn’t seem to accept variables in array.

For example, this will not work…

totals.Add RSTdata(“id”), 10
Response.Write(totals(RSTdata(“id”)))

However this will work just fine…

idNumber = RSTdata(“id”)
totals.Add idNumber, 10
Response.Write(totals(idNumber))

This isn’t quite as cool as the way ASP decides the forget about some variables but only after you’ve referenced them for the first time creating a rather nice heisenbug when you put in a few print lines but never the less interesting.

More job based commentary

Tuesday, June 17th, 2008

It’s week two of my job at Open Door Design and it’s coming along nicely. I’ve been working around with one of their previous big sites which I’ve really been able to get my teeth into and rip apart. It’s everything you expect when you get into the real world, I’ll leave you to fill in what that means :D .