SQL Transpose of WordPress meta tables (key-value pairs)

Here is sample demo sql:

select * from (

SELECT m.user_id,
MAX(CASE WHEN m.meta_key = ‘first_name’ THEN m.meta_value ELSE NULL END) AS first_name,
MAX(CASE WHEN m.meta_key = ‘last_name’ THEN m.meta_value ELSE NULL END) AS last_name
FROM wp_usermeta m
GROUP BY m.user_id

) as s where first_name = ‘John’

Source: http://stackoverflow.com/questions/3392956/sql-how-to-transpose

Posted in Uncategorized. Leave a Comment »

Warid 4G LTE v/s PTCL Evo 3G

I found a chance to test both internet services using USB wingle devices. I first checked the signals and then tried http://speedtest.net on it. I made these tests in morning around 6.30am (Location: gulshan-e-iqbal, block 4, Date: 19th June 2015)

1) Warid 4G LTE
2) PTCL Evo 3G
I hate to admit, but PTCL EVO 3G was far better than what 4G LTE is capable of. Perhaps Warid has limited the performance due to their SLAs. The uploading speed of LTE is better but most of us are concerned on downloading speed.
Posted in Uncategorized. 2 Comments »

JQueryUI with Metro Theme

A search for Metro theme based on Jquer UI actually resulted in this post. JQUIT builder seems to be promising option but it’s now unmaintained and all builder links are removed. I further searched and found a much similar cusotmization of jQuery UI to match like Metro.

Here is the Jquery UI theme link after my little modification.


Screenshot: http://tinyurl.com/n8p9ntp
Download: Metro Light | Metro Dark

You can replace metro blue shade with other high/low contrast colors of windows 8 (purple, orange, green etc).

Here are the links for color set.

Have fun.

Posted in Uncategorized. Leave a Comment »

“Go To File” Feature/Plugin for Notepad++

The plugin that I found that has this feature is called Open File in Solution

Here’s a link to download the plugin and documentation: http://npp.incrediblejunior.com/


  1. Install the above 4 plugins from here (I just downloaded them manually and dropped them in my plugins directory).
  2. Start Notepad++.  Select Plugins -> SolutionHubUI -> SolutionHubUI Show from the menu
  3. Here you define your solution or project.  Click “New Solution” and enter a Name.  Then click the “Path” icon and select it’s root folder.  Tick the “Recursive” and “Monitored” checkboxes to ensure the files within this folder are indexed, and you can optionally add Exclusions file filter to skip any files you don’t want indexed (like “jpg gif png” files).
  4. Click “Save Solution”, then double-click the “Connections” value in the table at the top and enter “ofis” as a connection for your new solution.  This will associate your solution with “Open File In Solution” to make this feature work.  Then click “Save Connections”.  (You can define multiple solutions/projects, but only one can have the “ofis” association at one time.  This provides a crude way of switching between solutions/projects)
  5. Now test your Solution by going to the menu and selecting Plugins -> Open File In Solution -> OFIS – Show.  You should see a dialog that allows you to search all the files in your solution.
  6. Now we’ll define some keyboard shortcuts.  Go to Settings -> Shortcut Mapper… and choose the “Plugin commands” tab.
  7. Find the entry called “OFIS – Show” and give it a shortcut.  I personally use Ctrl+Shift+R as that’s what I’m used to from Eclipse, however this is used by the out-of-the-box Macro Record.  So I have to disable this shortcut manually under “Main Menu” tab.  (Unfortunately Notepad++ doesn’t warn you if there’s a clash).
  8. Next, find the entry under the “Plugin commands” tab called “ST – Open document” and give this another short-cut.  This is how you open files that are referenced in your source (like F3 in Eclipse).  I personally map this to Ctrl-Shift-=.
  9. That’s it!

Source: http://superuser.com/questions/310147/go-to-file-feature-plugin-for-notepad

​One more tip. If you like the RubyBlue colour theme, grab the enhanced version that includes additional language support (like java). It’s available from: http://www.maxahn.com/2010/12/customized-ruby-blue-theme-for-notepad/.

Posted in Uncategorized. Leave a Comment »

5 Google Products That Failed and What Startups Can Learn From It

Visit following link. Saved just to bookmark on blog.


Posted in Uncategorized. Leave a Comment »

I’ve inherited 200K lines of spaghetti code — what now?

​I came across a very good question (as mentioned in title of post) and fantastic answer. This is common problem for senior developers / project leads who just landed on some previously coded project. I’ve seen such scenes quite a lot time and all ends in frustration and left unresolved.

Posting on blog for reference. Actual question / answers are here:

Top answer summary:

Executive Summary for the Impatient

  • Define a rigid project structure, with:
    • project templates,
    • coding conventions,
    • familiar build systems,
    • and sets of usage guidelines for your infrastructure and tools.
  • Install a good SCM and make sure they know how to use it.
  • Point them to good IDEs for their technology, and make sure they know how to use them.
  • Implement code quality checkers and automatic reporting in the build system.
  • Couple the build system to continuous integration and continuous inspection systems.
  • With the help of the above, identify code quality "hotspots" and refactor.

Now for the long version… Caution, brace yourselves!

Read here: http://programmers.stackexchange.com/questions/155488/ive-inherited-200k-lines-of-spaghetti-code-what-now

Posted in Uncategorized. Leave a Comment »

PHP library for Charts, Graphs, Guages & Dashboard

A PHP Chart library (www.chartphp.com) that promises to supports many features and looks to be an alternate to FusionCharts PHP wrapper, PHPChart, HighCharts PHP etc. Basically, A simple PHP wrapper is missing element in many charting libraries as it takes time to understand the JS api. Other factor to use these libraries is the Cost. From their website, here are some highlights of ChartPHP library:

  • HTML5 powered PHP Charts for Web and Mobile devices
  • Delightful & Hassle free – Line Charts, Multi-line Area Charts, Bar Charts, Pie/Donut Charts, Meter Guages, Funnel Charts and many more.
  • Supports databases including MySql, PostgreSQL, SQL Server, Oracle, DB2
  • Ready-to-Use PHP Sample Code & Demo Charts
  • Chrome, IE 7, IE 8, Firefox, Safari, and Opera Compatible

These libraries definitely save a lot of time, making admin reports, stats charts OR business kpi dashboards.

​The product website seems to be under development​ now.

Posted in Uncategorized. Leave a Comment »