There’re times when I need to quickly search through occurrences of certain phrases in my PHP source files. Here is when I have to search for ‘giraffes’.

This is an example finding the word ‘giraffes’ in all PHP source files from the current directory recursively.

find . -name "*.php" -exec grep -i -H -n "giraffes" {} \;

This works for Ubuntu, CentOS and Mac OS X.

 

I just returned from Bangkok not long ago. It was a good trip.

And now I’m going to Taipei. It’s okay to be envious, even I am envious of myself. I know however that it’s probably the only time I can go for two holidays in one month. My excuse is I didn’t take much leave from work last year.

The two holidays make up I guess. I want to try doing a lot more in Taiwan though. Perhaps pack my itinerary with so much activities just to experience the place more. My holidays are always extremely laid back which I suspect has something to do with my inability to reconcile with failures to commit.

Anyway, I’ll bring my laptop over to Taipei. Maybe do some writing and research there on where to travel to. I will love suggestions. My hotel will be at the Ximen MRT Station area, in Taipei city. First stop is likely Ximending.

 

During casual introductions, it perhaps isn’t particularly good to tell others what you do. I find that introducing myself as a web developer to friends of friends just kind of kills it all. Not because web developers are such nasty people — quite the opposite, most are nice — but that there’s a deep stereotype as to what a software engineer is like. I feel my identity is determined by my work — meticulous, overly logical, robotic and geeky. Furthermore web developer is an increasingly meaningless label since everyone knows a cousin could do what I do. Web programming is just one of the things that I can do. I could do more but in a one sentence introduction I can’t mention all. Now I just say my name and how I first met my friends. Not useful maybe, but rids the stereotype.

 

On the increasing usage of improper English, Joan Acocella of The New Yorker notes:

English is a melding of the languages of the many different peoples who have lived in Britain; it has also changed through commerce and conquest. English has always been a ragbag, and that encouraged further permissiveness. In the past half century or so, however, this situation has produced a serious quarrel, political as well as linguistic, with two combatant parties: the prescriptivists, who were bent on instructing us in how to write and speak; and the descriptivists, who felt that all we could legitimately do in discussing language was to say what the current practice was.

But the most curious flaw in the descriptivists’ reasoning is their failure to notice that it is now they who are doing the prescribing. By the eighties, the goal of objectivity had been replaced, at least in the universities, by the postmodern view that there is no such thing as objectivity: every statement is subjective, partial, full of biases and secret messages. And so the descriptivists, with what they regarded as their trump card—that they were being accurate—came to look naïve, and the prescriptivists, with their admission that they held a specific point of view, became the realists, the wised-up.

Source: New Yorker

I guess that will make me closer to a descriptivist since I think there’s nothing wrong with Singlish.

 

Well here it is, my typical .gitignore file for every project. This doesn’t change much. Specially it is written for Yii Framework and CakePHP:

Continue reading “My gitignore file for Yii Framework” »

 

Does your /etc/hosts file look like this?

127.0.0.1 gladlycode.local gladlycast.local
127.0.0.1 babyessentials.local kw.sg.local
127.0.0.1 localhost

Every request I made to gladlyCode.local takes 5 seconds to resolve to my local Apache server. Something was wrong!

If it does and you’re on Mac OS X Lion, you should change your VirtualHost names to something else. It turns out that Mac OS X Lion no longer looks up /etc/hosts first when you try to lookup a .local domain since are technically reserved for Multicast DNS (MDNS), or Bonjour. Starting Lion, it will lookup through MDNS first, and after the 5 second timeout, it checks with /etc/hosts.

This is at a cost of developer productivity and I have to change all my .local domains to .internal.kw.sg which is a domain name I own. I figured that if it is a domain name I own, it will never clash unknowingly. I changed ‘gladlycode.local’ into ‘gladlycode.internal.kw.sg’ and point it to 127.0.0.1 now. Now testing gladlyCode no longer takes 5 seconds per request (ridiculous!).

Alternatively you can use another top level domain (TLD) instead of .local and the common ones such as .com.

 

Russell Howard’s Good News Series 6 Episode 4 stand up from the brilliant Daniel Simonsen, enjoy!

Daniel Simonsen on Good News

 

WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.