This file contains 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 | |
/** | |
* Copyright (C) 2016 Prabhas Gupte | |
* | |
* This is free script: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This script is distributed in the hope that it will be useful, |
This file contains 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 | |
/** | |
* Copyright (C) 2016 Prabhas Gupte | |
* | |
* This is free script: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This script is distributed in the hope that it will be useful, |
This file contains 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 | |
$a=10; $b=20; | |
list($b, $a) = array($a,$b); | |
?> |
This file contains 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 | |
/** | |
* Copyright (C) 2016 Prabhas Gupte | |
* | |
* This is free script: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This script is distributed in the hope that it will be useful, |
This file contains 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 | |
/** | |
* ordinal_number.php - PHP function to get ordinal number. | |
* Pass it a number and it will return the number suffixed with either | |
* of "st" (like 1st), "th" (like 4th), "nd" (like 2nd), "rd" (like 3rd). | |
* Copyright (C) 2016 Prabhas Gupte | |
* | |
* This is free script: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
This file contains 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 get matching line and 5 lines before that | |
grep -B 5 "pattern" file | |
# to get matching line and 5 lines after that | |
grep -A 5 "pattern" file | |
# of course, you can combine -A and -B options together in single command. That's obvious. | |
# if your -A and -B values are same, you need not specify both the options. use -C instead. | |
grep -C 5 "pattern" file |
This file contains 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
Programming Laguages | |
PHP - currenly my bread and butter is earned with this language only | |
Javascript | |
Ruby | |
Editors | |
Eclipse, with PDT - on ubuntu as well as windows. This is my preferred editor | |
vim - only when working on terminal | |
nodepad++ - only when working on windows | |
Sublime Text 2 - trying this editor on linux as well as windows | |
Source Code Control |
This file contains 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 | |
/** | |
* Check whether all elements from $needle array are present in $haystack array. | |
* Works for single-dimentional arrays only. | |
* If you use multi-dimentional arrays, result could be misterious. | |
* @param array $needle | |
* @param array $haystack | |
* @return boolean true if all elements in $needle are found in $haystack. false otherwise. | |
*/ | |
function array_in_array($needle, $haystack) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer