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 fitToScreen(selector) { | |
| var element = document.querySelector(selector); | |
| var width = element.offsetWidth; | |
| var height = element.offsetHeight; | |
| var top = "-" + (height / 2) + "px"; | |
| var left = "-" + (width / 2) + "px"; | |
| var ratio = getRatio(width, height); |
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 | |
| interface Task | |
| { | |
| /** | |
| * @return bool | |
| */ | |
| public function shouldLog(); | |
| } |
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
| while 1; do; sleep 0.25; clear; ps -ax -o %cpu,command | grep worker.php; done |
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
| Loading composer repositories with package information | |
| Updating dependencies (including require-dev) | |
| - Removing dflydev/markdown (v1.0.0) | |
| - Removing nikic/php-parser (v0.9.0) | |
| - Installing nikic/php-parser (v0.9.5) | |
| Loading from cache | |
| - Removing doctrine/instantiator (1.0.2) | |
| - Installing doctrine/instantiator (1.0.5) | |
| Loading from cache |
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 bubble_recursive(array $items, $iterations = null) { | |
| if ($iterations === null) { | |
| $iterations = count($items); | |
| } | |
| $items = bubble_recursive_inner($items, $iterations); | |
| if ($iterations > 1) { |
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 | |
| Route::get("/test/{admin?}", function($admin = "zaher") { | |
| dd($admin); | |
| }); |
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 merge(data) { | |
| var length = data.length; | |
| if (length === 1) { | |
| return [data[0]]; | |
| } | |
| if (length === 2) { | |
| if (data[0] > data[1]) { | |
| return [data[1], data[0]]; |
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 bubble(data) { | |
| var length = data.length; | |
| while (length) { | |
| for (var i = 1; i < length; i++) { | |
| var prev = data[i - 1]; | |
| var next = data[i]; | |
| if (prev > next) { | |
| data[i] = prev; |
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 valid($file) { | |
| if (file_exists($file)) { | |
| $command = PHP_BINARY . " -l " . escapeshellarg($file) . " 2> /dev/null"; | |
| ob_start(); | |
| exec($command, $result); | |
| ob_end_clean(); | |
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 | |
| use Symfony\Component\Process\Process; | |
| $process = new Process('...'); | |
| $process->run(function ($type, $buffer) { | |
| if (Process::ERR === $type) { | |
| echo 'ERR > '.$buffer; | |
| } else { |