Author Archives: Torleif

About Torleif

Was born in Hønefoss (Norway) the 20th of January 1985 around 16:05. I am a Seventh-Day Adventist, a software developer and a hobby juggler.

JavaScript: Uppercase first letter in a string

In PHP there is a very handy function called ucfirst which Returns a string with the first character of str capitalized, if that character is alphabetic. Needed that in JavaScript, but discovered there was no such thing.

Posted in Software Development | Tagged , , | Leave a comment

PHP: How to easily provide JSON and JSONP

Have some server-side data that you would like to grab through an AJAX call? For example by using the jQuery.ajax method? A really easy way of doing this is by using the JSON format.

Posted in Software Development | Tagged , , , , | 2 Comments

PHP: Generating transparent PNG fillers

So, I was fooling around the other day with an HTML table and wanted to make the odd rows slightly darker. Figured I could use for example an 80% transparent black PNG to do that (or could have just assigned … Continue reading

Posted in Software Development | Tagged , , , , | Leave a comment

C#: How to send emails

Sending a basic email message in a C# application is quite easy thanks to a class called SmptClient. We simply need an address to send to, an address to send from, the message we want to send and the client: … Continue reading

Posted in Software Development | Tagged , , , , | Leave a comment

Universal Greeting Time (UGT)

Stumbled over the concept of Universal Greeting Time on IRC a little while ago. Found it kind of brilliant UGT (abbr.): Universal Greeting Time. UGT is convention initially established in #mipslinux on irc.openprojects.net (now irc.freenode.net) but slowly taking over the … Continue reading

Posted in Random | Tagged , | Leave a comment

How to enable verbose booting in Mac OS X

I’m a curious guy, so I wanted to see if there was anything interesting happening behind the Apple logo when the Mac I use at work boots up. Turned out it was quite simple to enable and disable this feature. … Continue reading

Posted in Technology | Tagged , , | Leave a comment

Kohana PHP framework

As you might know, I am developing some internal software for LifeStyleTV at the moment. Because of various slightly annoying circumstances I am stuck using PHP and MySQL for this. Not the worst of course, but I must say I … Continue reading

Posted in Software Development | Tagged , , | Leave a comment