Skip to main content

Posts

2013


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.

XSS Filter in Laravel Framework

XSS Filter in Laravel Framework

If you are connected with the PHP development world then you must have heard the name Laravel and you know what it is. If you don’t know, Laravel is a modern PHP framework which utilizes modern PHP features and uses some of the existing frameworks’ components to truly awesomify PHP development.

Back in 2012 I gave Laravel a try out of curiosity and I was amazed by the flexibility, features and easiness it offers. I took another decison to learn it and then to use it on my new projects. Now I have learned Laravel and developed projects using it. I am not leaving development with CodeIgniter, just using both, in fact my current long term work Vegan Cuts is based on CodeIgniter.

2012


Hide Twitter Replies - Google Chrome Extension

Hide Twitter Replies - Google Chrome Extension

Note: Finally, new Twitter profile has this feature built-in. This project is now deprecated and no longer supported.

Are you annoyed by the @replies on Twitter? Be it on any profile or news feed, it looks like a chat session. Now you can hide these annoying replies and you can see the genuine tweets. Install this extension on Google Chrome and you will find a Hide Replies button on Twitter, clicking it will hide all the replies, clicking it again will show the replies.

Goals of First Quarter of 2012

Goals of First Quarter of 2012

Goals of last quarter was a 100% success, alhamdulillah (praise be to God).

Now goals of first quarter of 2012:
Inshallah (God willing) I will :

  1. Build strong hands on Java with Android.
  2. Write 3 blog posts on tech stuff.
  3. Reach 2700 reputation level at Stack Overflow http://stackoverflow.com/users/656489/usman.
  4. Contribute on some selected projects on Github.
  5. Finish the book jQuery Novice to Ninja.
  6. Have a revitalizing tour.
  7. Read 2 Islamic Books.

(2 entries hidden)

2011


Bangla Font for Android (without rooting)

Bangla Font for Android (without rooting)

 
Newer versions of Android handles Unicode really well. This project is now deprecated and no longer supported.

I have received too many requests for a Bangla Font for Android. Unfortunately Android is not so matured in handling Unicode and Complex Script and there was no way of installing new font without rooting the device, but Samsung has come up with a great way allowing installing fonts. So I have created this Bangla Font which will work on Samsung Devices or other devices with custom font support, so now you can see Bangla in Applications, but don’t get too excited, the complex script (Jukto Borno and so) may not appear correctly in some devices, also some carriers may create some problems. I have tried a lot to solve the issue but I couldn’t, well I said Android is not that matured in that way. So this Font comes without any warranty, so I haven’t published it in the Android Market.
There is a proverb in Bangla:
নাই মামার চেয়ে কানা মামা ভাল

WordPress like Option feature for your CodeIgniter application

WordPress like Option feature for your CodeIgniter application

If you have developed a large application you may have faced this problem, in some cases we have some settings or options to save in the database but the data is not so large to create a db table for it, also it may do not require many rows. In that case we should have a table for settings, where we can store all our settings or options with a key then retrieve it. Our option can be a text value or an array or an object. WordPress has a really good feature for such cases its the Option Mechanism. By using the appropriate function, options can be added, changed, removed, and retrieved.