So I’ve had on my to do list for a while a bit of coding to take an input text and add ‘rel=”nofollow”‘ to any links that don’t already have it set. In theory it’s a straightforward thing to do, either use a regex or something like DOMDocument to parse the text. But it’s a bit of a faff and I haven’t gotten round to it yet.
I have though having a play around with ChatGPT and chatting to a friend he said “have you used it for coding yet”. So I thought this one might be a good place to start checking it out and wow is it good.
As you can see from the screenshot above in a matter of a minute or so I have my function. But looking at that I thought “I wonder if it’d be better with regex”. So why not ask?
It’s a simple as typing “rewrite the function using regex instead of DOMDocument” and here’s the new output.
I really think ChatGPT does have the power to be game changing here, there are a few caveats though, one being I think you need to have some idea of what you’re expecting back and I’d probably make sure to test what you’re getting quite thoroughly as well. But if you learn how to ask and refine your requests you can get some great stuff back.
There’s a great podcast from Drowned in Sound that whilst it approaches it from a musician perspective gives some great info about how to use these new AI tools
My standard contract (based on Andy Clarke‘s contract killer) includes a clause about creating designs for the latest version of current modern browsers and any older versions will get a workable version of the content. I do of course do some more specific catering for a certain browser if needed but generally building something sensibly and providing the correct fallbacks works well enough for clients.
But sometimes they question why I work this way? I find the best way to explain is with the good old movie making analogy – one I touched upon in an old Smashing Magazine article about using CSS3. It works well as it’s something people are more familiar with, even if they don’t watch a lot of films they will know the terminology and ideas you’re explaining.
So how does the moving making analogy go? A little like this. Continue reading →
I’ve been a long time Google Reader user and I’ve realised that I’ve never really looked much further. I started using it many moons ago and it’s always worked and done what I want so I’ve never looked at anything else.
But Reader is being killed off by Google in July and many people are predicting a decline in RSS usage because of it, I can’t really see that happening. It most certainly won’t be replaced by social media. Continue reading →
In my last proper post I introduced a couple of resources I recommend to those getting started on the web.
But where do you go from there to keep up to date and continue learning? Apart from browsing these hallowed pages of course.
Here are a few of the resources I regularly use to keep track and reference, I have plenty more in my RSS reader (Google reader! I’ll be looking for an update) but these are the ones I regularly end up visiting and reading from. They offer a variety of levels of interest and difficulties.
Since I started writing a post a week this year this is the first time I’m found myself without anything posted by Sunday. I had thought I’d write up something that’s already saved in a draft state, but I was late back from work and I’m at my mums and, here in the UK at least, it’s Mother’s Day.
So I’m doing what many people recommend all the time and what I certainly like to recommend to people, I’m having a break.
I’ve a busy week next week but I’ll make sure it isn’t a post-less one!