Masters degree

Pursuing a Masters degree has been part of my plan. The dilemma was: When?

A year ago I had my life planned differently. Settle down, have a job, get married, build something smart and then maybe take the next academic step, in Egypt.

Now, it seems that is not an option any more. I have a job, I am happy with what I do but I really want to move forward with my life. I checked, and it seems that my Plan A will not work – and I finally decided to believe that it won’t work. Therefore, Plan B is up.

Plan B was to work, know what the market wants, and pursue either MBA or M.Sc. in Software Engineering. Deep inside I believe I would make a good manager. However, I want to be a better Software Engineer based on strong academic background and rich working experience. The working experience is good when I decide to work besides my studies. Therefore, deciding to work first is, for me, a win-win situation.

I will be starting my masters applications this year – Maybe start next April if I got accepted somewhere abroad. Wish me luck.


NEW! features in Sorting WooCommerce Pro plugin

Today I’ve released a new version of the Sorting WooCommerce Pro Plugin. The plugin introduces two additional features proposed and suggested by customers.

Per Category Sorting!

The plugin up to v1.3.2 provided the option to create custom sorting options using custom attributes or default ones. However, the sorting options were general to the entire shop! The plugin now provides the option to specify that a sorting option appears only in a certain category. For as, Tea is different than Coffee. Both have different attributes that would be meaningless in the other’s context.

Sorting Icon Shortcode

Place the shortcode anywhere and get the sorting icon that changes the sorting of the items from ASC to DESC and vice versa for the same attribute! Check these awesome features and more in the plugin’s page.

[WooCommerce] Sort by Custom Attributes


I created a plugin for this plus many other features. Click here to view it.

To add extra sorting options to your WooCommerce pages using products’ meta data you can use the following

However, I wanted to add some sorting options that use the WooCommerce’s custom attributes. According to this thread, the product attributes are saved in a serialized format in the database and therefore it’s not feasible to do it directly.

To use the provided WooCommerce filters the attributes should be saved as meta data.

When a post that has some custom attributes set is updated, the submitted data ($_REQUEST) contains the following:

'attribute_names' =>
 array (
 0 => 'pa_pub-year',
 1 => 'pa_pub-author',
 'attribute_position' =>
 array (
 0 => '1',
 1 => '1',
'attribute_is_taxonomy' =>
 array (
 0 => '1',
 'attribute_values' =>
 array (
 0 => '1990',
 1 => '',
 2 => '',

The approach I followed is to get the submitted attributes and save them as post meta data. Afterwards, the code provided by WooCommerce to sort using attributes, with a tiny modification, worked successfully.

The code is as follows

/************* Add sorting by attributes **************/

 *	Defines the criteria for sorting with options defined in the method below
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args');

function custom_woocommerce_get_catalog_ordering_args( $args ) {
	global $wp_query;
        // Changed the $_SESSION to $_GET
	if (isset($_GET['orderby'])) {
		switch ($_GET['orderby']) :
			case 'pa_pub-year' :
				$args['order'] = 'ASC';
				$args['meta_key'] = 'pa_pub-year';
				$args['orderby'] = 'meta_value_num';
	return $args;

 *	Adds the sorting options to dropdown list .. The logic/criteria is in the method above
add_filter('woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby');

function custom_woocommerce_catalog_orderby( $sortby ) {
	$sortby['pa_pub-year'] = 'Sort by Year: Older to Newer';
	return $sortby;

 *	Save custom attributes as post's meta data as well so that we can use in sorting and searching
add_action( 'save_post', 'save_woocommerce_attr_to_meta' );
function save_woocommerce_attr_to_meta( $post_id ) {
        // Get the attribute_names .. For each element get the index and the name of the attribute
        // Then use the index to get the corresponding submitted value from the attribute_values array.
	foreach( $_REQUEST['attribute_names'] as $index => $value ) {
		update_post_meta( $post_id, $value, $_REQUEST['attribute_values'][$index] );
/************ End of Sorting ***************************/

This should be placed in the functions.php file of your theme.


So I went to an incubator ..

Kindly check the Flat6Labs reply at the bottom of the pageAlso make sure to read the proposed business plan/model and the one being executed now.

Flat6Labs is a successful and reputable incubator located in Egypt. They’ve already done great work and helped many people with potential and great skills creating and managing their own companies and leading them to success.

I, like many others, had an entrepreneur idea. I was encouraged to apply to Flat6Labs through a friend (who he himself is incubated by Flat6Labs). The application email can be seen below.

Briefly, my application was about a service which allows people to help each other get items from other countries instead of using an expensive shipment service.

However, I did not have a team ready back then. I went in for a quick chat and we settled that whenever I am ready I can apply again, even though they “did not like the idea that much,” and found plenty of flaws in the model of my proposal. To be honest, it was a constructive feedback.  I was told whenever I get any other ideas, I should not hesitate to contact them about it. Generous, nice, and marvelous supporting people and environment that I wish I could have joined.

Around the 10th of May 2013, Flat6Labs announced the list of companies they incubated, one of which is named Zaagel, founded by a person who cooperated with Flat6Labs before. Zaagel has pretty much the same features that I included in my application (shown below).

Continue reading



First year at college and they ask for our emails if we’re interested to join the University’s ACM team. I sent the email and never got a response. I hated the ACM idea since then.

3 years later, I discover that the message resides in my drafts. I never sent it.


If you use Gmail, then you probably know that the dots in the usernames are ignored. Galal.Aly or GalalAly, it’s the same inbox for Gmail. It’s not for Gtalk. I learned that the hard way. I was removing duplicates from my contacts and removed the email with the dot from Gtalk, assuming that the same one with no dots will compensate for it. Unfortunately, that wasn’t the case. I blocked someone, accidentally!

That got me thinking, what other undiscovered stuff are still there? hidden stuff that caused hatred/sadness, misunderstandings?

MagCloud Widget WordPress plugin

HP MagCloud is a web service that empowers users to self-publish and distribute content—for business or personal use—as a professional-quality print publication or digitally for mobile and online viewing on today’s most popular devices.

After uploading your PDF, one way of advertising your published magazine is to copy and paste some HTML code to your website. However, the HTML is not always matching the design of the blog. This widget will allow people to paste MagCloud HTML code, write their own template, and with the help of some short codes they get the output that match their themes.

I did it for a client but found it might be useful for somebody out there and here you go.