Skip to main content

Posts

2014


Charisma - free, responsive, multiple skin admin template

Charisma - free, responsive, multiple skin admin template

Charisma is a full featured, free, premium quality, responsive, HTML5 admin template (or backend template) based on Bootstrap 3 from Twitter, it comes with 9 different themes to suit your style and application type.

Charisma helps you minimize the repeat work you have to do on you projects. You can re-use Charisma as a base or as a package for your admin panel. It’s free for personal and commercial use and you can use it in multiple sites.

Why Many Good Developers Don't Get a Good Job

Why Many Good Developers Don't Get a Good Job

I have seen lots of really good developers looking for work and they don’t find good work for months or years. On the other hand I’ve seen some really good companies looking for developers and they don’t find good developer for months or years. What’s the problem? After looking at the situation of some of the developers and companies I have tried to find out the reason behind it. Let me share my thoughts with you.

New York Trip and The Laravel Conference

New York Trip and The Laravel Conference

I work remotely for Vegan Cuts, which is based in Canada and I work from Bangladesh. As the team is distributed, Vegan Cuts arranges meetings every year in different countries. This time I was invited to visit New York :).

It was a long journey for me, Sylhet > Dhaka > Istanbul > New York City, 20+ hours just in flight. I took 1.5 day break in Istanbul and explored the city, amazing, I must say.

Don't Fear Exceptions

Don't Fear Exceptions

If you’re not one of the few, you surely get scared once you see one of these:

Fatal error: Uncaught exception ‘Exception’ with message ‘Not found’ in /home/usman/www/test.php on line 27

Fatal error: Uncaught exception ‘UnexpectedValueException’ in /home/usman/www/test.php on line 27

When you see Red or Orange screen with Exception you fear like you’ve committed a sin and just go back to code to repent. Congrats, you’re the majority.

What if I told you that Exceptions are no sin, rather blessings of object oriented programming?
What if I told you that an Exception doesn’t just mean that your code is wrong?

2013


Strana - Smart Pagination Library for PHP

Strana - Smart Pagination Library for PHP

A framework agnostic, smart pagination library for PHP. Just a few lines of code and fully functional pagination is ready.

Paginate your records with Strana. Strana will slice(limit and offset) these records, generate pagination links for you and reads page number from them, all automatically.

Features: #

  • Built-in adapters for Doctrine, Eloquent (Laravel), Pixie, PHP Array and you can do it manually.
  • Readable syntax
  • Add Infinite Scroll with one line
  • It automatically detects which DBAL you are using.
  • Styles automatically with Twitter Bootstrap, Zurb Foundation and most of other CSS frameworks.

Check out the installation instructions and documentation on GitHub.

Pixie - A Database Query Builder for PHP

Pixie - A Database Query Builder for PHP

It took me few weeks to build Pixie, a lightweight, expressive, framework agnostic query builder for PHP, it can also be referred as a Database Abstraction Layer. Pixie supports MySQL, SQLite and PostgreSQL and it takes care of query sanitization, table prefixing and many other things with a unified API. At least PHP 5.3 is required.

It has some advanced features like:

  • Query Events
  • Nested Criteria
  • Sub Queries
  • Nested Queries
  • Multiple Database Connections.

Check out the installation instructions and documentation on GitHub.

PHP Router in 140 Characters

PHP Router in 140 Characters

This is a dimple(damn simple) URL routing script for PHP which is written in just 140 characters of code, so it fits within a tweet.

It’s NOT a good router at all, don’t use it in a real application, it’s not exception handled either. I did it just for fun and to demonstrate the simplicity.

So here’s the router code, and that’s all (seriously).

   
class R{  
function a($r,callable $c){$this->r[$r]=$c;}  
function e(){$s=$_SERVER;$i='PATH_INFO';$p=isset($s\[$i])?$s[$i]:'/';$this->r[$p\]();}  
}  

Fork on GitHub

GetSetGo - Dynamic Setter Getter Library for PHP

GetSetGo - Dynamic Setter Getter Library for PHP

GetSetGo is a dynamic setter-getter library for PHP 5.4+. Its developed by me and Sheikh Heera, and yes, it’s well unit tested.

You can use methods like setFoo('bar') and getFoo(), which you DON’T have to create (in your class). GetSetGo will make these methods work for you automatically as long as you have a $foo property in your class.

It makes use of Traits, so using it is super simple, you don’t have to extend any class, as you can extend a single class only, we don’t force you to use ours.
You can restrict to only getter only or you can specify a Type for property using annotations.

Laravel 4 Uses Lots of Static, Not True.

Laravel 4 Uses Lots of Static, Not True.

Most of the time developers blame Laravel for using too much static. This claim is not true in case of Laravel 4, let’s dig in and discuss why and how.

What is static? #

In PHP you call it like this Class::$property.

As the name suggests, it preserves the state. Static variables preserve their values across the lifetime of the running application(in our case request). In a class if a static property is declared it becomes the property of the CLASS itself, NOT the property of the instance(s) of the class.

Filter Eloquent Results by Overriding in Laravel (v 3 & 4)

Filter Eloquent Results by Overriding in Laravel (v 3 & 4)

 
  Now Laravel has this feature [built-in](http://laravel.com/docs/4.2/eloquent#query-scopes)

What is Eloquent? #

Eloquent has been a really popular ORM in the PHP community lately, it was initially built for Laravel framework only. But since Laravel 4 all the components including Eloquent are built as Packages which may depend on other packages. These packages can be installed through Composer and can be browsed on Packagist. So what’s cool? Think of people out there who either don’t use Laravel or don’t use any framework at all. They might roll their own code or just whack a bunch of packages (like Eloquent) from Packagist together. If you use Laravel you can install and use various Symfony components/packages or any other package like Hybrid Auth with a simple command.