Estimated Price Tag: $1.1 million McLaren is recently tested its new super car version in the desert..Hope it will be handed over to premium customers very soon………
Author: smarttips
add css style using jQuery
Programmers using this technique for dynamic css styling. For Example: jQuery(“#smarttips.in-email”).css(“border-color”, “#C00”);
usort() function Issue with PHP 5.3
There is an issue existing with usort() function. Problem is purely related to php version, the old syntax is not work well in php 5.3 Here is the fix for usort() function Issue with PHP 5.3 usort($aResult, function ($elem1, $elem2) { return strcmp($elem1[‘title’], $elem2[‘title’]); }); solution Use a different function. usort($aResult,”mySort“); function mySort($elem1,$elem2){ return strcmp($elem1[‘title’],…
Procedure for undoing git checkout
Procedure for undoing git checkout git checkout <project development version name> git reset –hard <commit message> git push origin <project development version name>
Export large sql table data to csv using php(socialengine)
//function to download all users deatails to csv public function downloadcsvAction() { ob_end_clean(); set_time_limit(0); ini_set(‘memory_limit’, ‘2024M’); $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); $query=Engine_Db_Table::getDefaultAdapter()->select() ->from(‘engine4_users’,array(‘user_id’,’email’,’displayname’,’level_id’,’enabled’,’approved’,’intro_page’,’creation_date’)) ->where(‘user_id <> ?’, 1) ->where(‘user_id not in (?)’, array(‘685′,’870′,’948′,’965′,’1031′,’1249′,’1279′,’1283’)) ->where(‘user_id <> ?’, 6); $aResult= $query->query()->fetchAll(); $fileName = “users_”.time().’.csv’; header(‘Content-Type: application/csv’); header(‘Content-Disposition: attachement; filename=”‘.$fileName.’”‘); $f = fopen(‘php://output’, ‘w’) or show_error(“Can’t open php://output”); $n = 0; $line…