start new:
tmux
start new with session name:
tmux new -s myname
| /** | |
| * jQuery afterTime() method is simply setTimeout() function that can be used to chain with jQuery selectors | |
| * @param {ms} sec [the callback will excute after] | |
| * @param {function} callback [the function to excute] | |
| * @return {jQuery selectors} | |
| */ | |
| jQuery.fn.extend({ | |
| afterTime: function (sec, callback) { | |
| that = $(this); | |
| setTimeout(function () { |
| @ECHO OFF | |
| TITLE Task Scheduling | |
| :runSchedule | |
| php artisan schedule:run | |
| TIMEOUT /T 60 /NOBREAK > nul | |
| goto runSchedule |
| /* Addition Style */ | |
| /* | |
| none: 0px | |
| sm: 5px | |
| normal: 10px | |
| lg: 22px | |
| xl: 40px | |
| */ | |
| .padding-none { | |
| padding: 0px !important; |
| <?php | |
| function checkBOM($filePath) { | |
| $isBOM = false; | |
| if (is_file($filePath)) { | |
| $str = file_get_contents($filePath); | |
| $bom = pack("CCC", 0xef, 0xbb, 0xbf); | |
| if (0 == strncmp($str, $bom, 3)) { | |
| $isBOM = true; | |
| $str = substr($str, 3); | |
| file_put_contents($filePath, $str); |
| // Jquery exists function | |
| /** | |
| * jQuery exists() method can check if a selector matches or not | |
| * @return {boolean} | |
| */ | |
| jQuery.fn.exists = function() { | |
| return this.length; | |
| } |
| def addGroupToRegexString(str, start, end, groupsAdded): | |
| start += groupsAdded * 2 | |
| end += groupsAdded * 2 | |
| return str[0:start] + '(' + str[start:end+1] + ')' + str[end+1:] | |
| def fillGroups(regex): | |
| import re | |
| if str(type(regex)) == "<class 're.Pattern'>": |
| function binarySearch(arr, x) { | |
| let start = 0, end = arr.length-1; | |
| while (start <= end){ | |
| const mid = Math.floor((start + end)/2); | |
| if (arr[mid] === x) return mid; | |
| else if (x > arr[mid]) | |
| start = mid + 1; |