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 getLongestSubStrings($str) { | |
| $array = str_split($str); | |
| $arrayLen = sizeof($array) - 1; | |
| $noRepeatitiveSubStringFoundMsg = 'No repeated substring'; | |
| $longestRepeatedStringLen; | |
| $longestSubstringsFound = ''; | |
| for ($i=0; $i < $arrayLen / 2; $i++) { | |
| $groupOf = $i + 2; |
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 hasLeftNode($node) { | |
| return array_key_exists(0, $node); | |
| } | |
| function hasRightNode($node) { | |
| return array_key_exists(1, $node); | |
| } |
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 getDistinctElementsCommonToAllRows($matrix) { | |
| $matches = ''; | |
| $matrixLength = count($matrix); | |
| $matrixLastIndex = $matrixLength - 1; | |
| $matrixPivotIndex = round($matrixLastIndex / 2); | |
| for ($i=0; $i < $matrixPivotIndex; $i++) { | |
| $row = $matrix[$i]; | |
| $anotherRow = $matrix[$matrixLastIndex - $i]; |
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 | |
| class Curl { | |
| private $_ch; | |
| protected $opts; | |
| private function __construct($config) | |
| { | |
| $this->_ch = curl_init(); | |
| } |
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 | |
| // Server: Apache2 | |
| // Language: PHP7.0.17-2 | |
| // HTML5, CSS3 & JS | |
| define('ENV', 'DEVELOPMENT'); | |
| error_reporting(-1); | |
| ini_set('display_errors', ENV !== 'PRODUCTION'); | |
| if(request()->isAjax && request()->isPost()) |
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 | |
| http_response_code(503); | |
| if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])) : | |
| echo json_encode("Website is under maintenance"); | |
| endif; | |
| ?> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Site Maintenance</title> |
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
| alias checkoutsites='cd /var/www/html' | |
| alias getStagingApiIp='ping some-host-name' | |
| alias getCoverageFilesList='git diff --name-only origin/develop | grep -v public/ | grep -v api/ | grep -v styles | grep -v __tests__ | grep -v action_types' |
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 | |
| if(!function_exists("server")) { | |
| function server() { | |
| return new Server(func_get_args()); | |
| } | |
| } | |
| class Server { | |
| private CONST SERVICES = ["www","http","https","mysql","smtp","imap","pop3","ftp","ssh","sftp","telnet","nicname","gopher","finger"]; | |
| private CONST PROTOCOL = ["tcp","udp"]; | |
| private CONST VALID_KEYS = ["all"=>"a","os"=>"s","release"=>"r","version"=>"v","bits"=>"m","hostname"=>"n"]; |
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 | |
| $firstSeqArr = []; | |
| $secondSeqArr = []; | |
| $operations = 0; | |
| while($str = fgets(STDIN)){ | |
| $trimmedStr = trim($str); | |
| $trimmedStrSplit = str_split($trimmedStr); | |
| if(empty($firstSeqArr)) { | |
| $firstSeqArr = $trimmedStrSplit; | |
| } else { |
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 | |
| $apache_modules = apache_get_modules(); | |
| $required_modules = ["mod_rewrite","mod_macro","mod_ssl"]; | |
| $modules = $apache_modules + $required_modules; | |
| $loaded_extensions = get_loaded_extensions(); | |
| $required_extensions = ["ctype","curl","date","dom","gd","fileinfo","json","mycrypt","PDO","Reflection","SimpleXML","xdebug","xml"]; | |
| $extensions = $loaded_extensions+$required_extensions; | |
| ?> | |
| <!DOCTYPE html> |