This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style type="text/css"> | |
| div.scroll | |
| { | |
| width:500px; | |
| height:400px; | |
| overflow:scroll; | |
| } | |
| </style> | |
| <div class="scroll"> | |
| some text is present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://stackoverflow.com/questions/6278296/extract-numbers-from-a-string | |
| // to get integer from string | |
| preg_match_all('!\d+!', $string, $matches); | |
| print_r($matches); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scp [email protected]:foobar.txt /some/local/directory | |
| http://www.hypexr.org/linux_scp_help.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $db = JFactory::getDbo(); | |
| $query = $db->getQuery(true); | |
| $query | |
| ->select($db->quoteName(array('a.bid_date', 'a.user_id', 'b.auction_name'))) | |
| ->from($db->quoteName('#__lots_bid', 'a')) | |
| ->join('INNER', $db->quoteName('#__auction_mgmt', 'b'). ' ON (' . $db->quoteName('a.auction_catalog_id'). ' = '. $db->quoteName('b.auction_catalog_id'). ')') | |
| ->where($db->quoteName('a.user_id'). ' = '. $userid); | |
| // echo $query; | |
| $db->setQuery($query); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO `countries` (`id`, `name`) VALUES | |
| (1, 'India'), | |
| (2, 'Afghanistan'), | |
| (3, 'Akrotiri'), | |
| (4, 'Albania'), | |
| (5, 'Algeria'), | |
| (6, 'American Samoa'), | |
| (7, 'Andorra'), | |
| (8, 'Angola'), | |
| (9, 'Anguilla'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.log(Number(monthly_income).toLocaleString()); | |
| console.log(Number(monthly_income).toLocaleString('en')); | |
| toLocaleString is obselete | |
| https://syedabdulbaqi.wordpress.com/2009/03/10/javascript-function-for-converting-string-into-indian-currency-format/ | |
| //function for converting string into indian currency format | |
| function intToFormat(nStr) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To sort multidimentional array | |
| public function array_msort($array, $cols) | |
| { | |
| $colarr = array(); | |
| foreach ($cols as $col => $order) { | |
| $colarr[$col] = array(); | |
| foreach ($array as $k => $row) { $colarr[$col]['_'.$k] = strtolower($row[$col]); } | |
| } | |
| $eval = 'array_multisort('; | |
| foreach ($cols as $col => $order) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ($array == array_intersect(range(min($array), max($array)), $array))) { | |
| //in sequence | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // your code goes heref | |
| function getRemainder( $n, $d ) | |
| { | |
| for($i =1; $i<$n; $i++) { | |
| if( $n == $d*$i) { | |
| $remainder = 0; | |
| $quotient = $i; | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // your code goes heref | |
| function getAngle( $h, $m ) | |
| { | |
| //conver hrs and mins to degrees | |
| $degreeHour = $h * 5 * 6; | |
| $degreeMinute = $m * 6; | |