JavaScript Tetris

Posted on June 12, 2009

Because I have nothing better to do with my time I wrote a Tetris game in JavaScript. I know there are plenty out there already but it was fun to make and it brought back some memories (I wrote my first Tetris game in DOS when I was 14). Coincidentally, Tetris just turned 25.

I released it under GPL, feel free to grab the code from the source and do whatever you like with it.

Play the game at elbertf.com/tetris

Object Oriented CSS

Posted on May 16, 2009

Okay, there is no such thing as object oriented CSS. But there are advantages in OO programming that we can use in CSS.

1
2
3
4
5
6
7
p {
    margin: 0;
}
 
#content p {
    margin: 1em 0;
}

In this example p would be a class and #content p would be an instance of that class. Let’s say the margin set in p is a method and we got the basic concepts of OOP.

Read more…

Swiftlet 1.0.0 Stable

Posted on May 08, 2009

Swiftlet logoSwiftlet, the light-weight PHP framework that I’ve been working on for a while, is now stable.

Feature-wise not much has changed since the Beta and Release Candidate cycles but the code has been thoroughly tested and improved where possible. If you’re planning on building a PHP website, give Swiftlet a try.

I moved the project page and documentation away from Google Code, if you go to swiftlet.org you’ll find the new page. It’s powered by a documentation system that I custom coded (dubbed Pintail). If there is any interest I will release the code behind it as Open-Source as well.

Swiftlet Beta

Posted on May 02, 2009

Swiftlet logoSwiftlet is now in beta, after 15 alpha cycles I’m confident that it’s now pretty much feature complete (there core that is, there will be plenty more plug-ins) and relatively stable.

One of the most important recently added features is the plug-in installer. It checks for compatibility with the core code and creates and populates database tables with a click of the mouse. Plug-ins that don’t require a database connection don’t need to be installed; they’re plug-and-play (and Swiftlet runs fine without a database).

I also added plug-ins to handle user sessions and authorization. This should make it easy to create a website that requires a login system.

Download: code.google.com/p/swiftlet/downloads/list

Swiftlet — light-weight PHP framework

Posted on April 25, 2009

Swiftlet logoI just released an early alpha version of Swiftlet, an Open Source, light-weight PHP framework released under the GPL license.

It’s targeted at developers who want to built simple websites that don’t require large and complex frameworks, but do want a solid base to work from. Swiftlet provides basic security features such as user input sanitizing, is highly extensible thanks to the deeply integrated hook system, completely Object Oriented and separates logic from design (MVC).

Even the most basic features such as connecting to a database and output buffering are implemented as plug-ins. This means they can be modified, extended and removed without hacking into the core code.

Website: http://swiftlet.org

First Twitchance winner announced

Posted on April 06, 2009

I just announced the first winner on Twitchance: @benjaminluk gets the $500!

6S Marketing made a bold move supporting Twitchance by being the first sponsor. The concept was unproven and perhaps a bit controversial but they were curious and decided is was worth a try. I encourage you to follow them on Twitter.

The next draw is on April 20, this time sponsored by Hover who provided another $500 and 20 smaller prizes.

We decided to make a small concept change: instead of randomly selecting a winner the sponsor and I pick the most creative message on Twitter and award the author with the prize.

To join, simply follow the instructions on the Twitchance website.

PHP: How not to pollute the global scope

Posted on March 28, 2009

An emerging trend in JavaScript is to wrap entire programs in a single object to prevent conflicts with other scripts. The same can be done with PHP, something I haven’t seen done very often.

Read more…

Tips for writing compact PHP code

Posted on March 25, 2009

Writing compact code can save you time. It’s not always recommended and often even strongly discouraged as it makes your code less readable, but for simple operations it can be more efficient. In this post I will give a few examples.

Read more…

Twitchance

Posted on March 24, 2009

A few days ago I launched Twitchance, a free Twitter lottery. It’s a viral marketing experiment where I’m going to give away some cash ($500.- on the first draw).

The concept is simple; participants post a message from a sponsor on Twitter. After some time a winner is randomly selected and awarded the prize. The sponsor receives amplified outreach to the online world.

Many companies offer services for free on the internet, often powered by advertisements. I figured the same could be done with a lottery. Twitter has a huge user base and tracking specific messages is easy, making it the perfect place for a project like this.

Anyone can join, all you need is a Twitter and Paypal account.

“Just another WordPress weblog”

Posted on March 24, 2009

I started this blog to write about my on-line projects and share insights and interesting finds on the web. Occasionally I might post a few tips and tricks for programmers and designers.

I’m a programmer myself, I write most of my applications in PHP and JavaScript. I built websites for a living and often work on experimental projects on the side.

This is my first WordPress blog, I used to share science and technology related articles on Blogger but never published any unique content. I also have a discontinued blog on Tumblr where I posted updates about one of my apps, Wappalyzer. I’m going to post the updates here from now on.

WordPress Theme

I started off with the Modicus theme from Upstart Blogger and turned it into something completely different. It’s a work in progress.

Plugins in use

If you’re interested in what I have to say, please subscribe to my feed and follow me on Twitter.

Fork me on GitHub