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
| /** | |
| * Gets param value of query string by name | |
| * @param name | |
| * @param url | |
| * @returns {*} | |
| */ | |
| function getQueryParamByName(name, url) | |
| { | |
| if (!url) url = window.location.href; | |
| name = name.replace(/[\[\]]/g, "\\$&"); |
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 | |
| $date = '2012-01-01 12:12:12'; | |
| $r = validateDateFormat($date); | |
| var_dump($r); | |
| /** | |
| * Validates date(or date time) format | |
| * @param $date |
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
| // source: http://robdodson.me/javascript-design-patterns-singleton/ | |
| var mySingleton = (function () { | |
| // Instance stores a reference to the Singleton | |
| var instance; | |
| function init() { | |
| // Singleton |
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
| sudo adduser <username> sudo |
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 | |
| $perms = fileperms($target_path); | |
| if (($perms & 0xC000) == 0xC000) | |
| { | |
| // Socket | |
| $info = 's'; |
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
| $(function(){ | |
| // create form on the fly | |
| var $new_form = $('<form>', { | |
| 'action': '<?php echo BASE_URL; ?>/operation/reset_member_password', | |
| 'method': 'POST', | |
| 'target': '_top' | |
| }).append(jQuery('<input>', { | |
| 'name': 'member_id', | |
| 'value': member_id, | |
| 'type': 'hidden' |
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
| /** | |
| * Select text of element by element id | |
| * @param element | |
| */ | |
| function selectText(elementId) | |
| { | |
| var | |
| doc = document, | |
| text = doc.getElementById(elementId), | |
| range, |
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 | |
| function isWeekend($date) { | |
| return (date('N', strtotime($date)) >= 6); | |
| } | |
| ?> |
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 tbl_media_files_tmf(entity_type_id,entity_id,file_name,media_type,sort_order,status,created_date,update_date) | |
| SELECT CONCAT("37"),entity_id,CONCAT(substring_index(file_name,'.',1),'_mobile.jpg'),media_type,sort_order,status,created_date,update_date FROM tbl_media_files_tmf where entity_type_id=29; |
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
| /* Only number input fields */ | |
| jQuery.fn.ForceNumericOnly = | |
| function() | |
| { | |
| return this.each(function() | |
| { | |
| $(this).keydown(function(e) | |
| { | |
| var key = e.charCode || e.keyCode || 0; | |
| // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY |