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 | |
namespace Jawira\Tests; | |
use function sleep; | |
function write($message): void | |
{ | |
echo $message; | |
} |
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 | |
/** | |
* Download and install Phive without wget nor curl | |
* | |
* Very useful for CI when using alpine images. However you will need to run | |
* `apk add ncurses` in order to execute Phive. | |
* | |
* If you want to run this with "php -r" you should first escape all '$' signs. | |
* | |
* @author Jawira Portugal <dev@tugal.be> |
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
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
try { | |
assert_options(ASSERT_ACTIVE, true); | |
assert_options(ASSERT_BAIL, true); | |
main(); | |
} catch (Exception $e) { | |
die($e->getMessage()); |
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 | |
/** | |
* Created by PhpStorm. | |
* User: jawira | |
* Date: 15.03.16 | |
* Time: 10:03 | |
*/ | |
namespace Dummy\MyTime; | |
const MONTHS = 12; |
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
-- Source: http://stackoverflow.com/questions/650238/how-to-show-the-last-queries-executed-on-mysql | |
SET GLOBAL log_output = "FILE"; | |
SET GLOBAL general_log_file = "/path/to/your/logfile.log"; | |
SET GLOBAL general_log = 'ON'; |
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 | |
/** | |
* Succinct Fibonacci function | |
* | |
* Returns the first N Fibonacci numbers specified as parameter. | |
* | |
* This function has not been written for efficiency nor readabilty, instead it has | |
* been created for fun and for testing the latest PHP features (E.g.: generators, | |
* literal dereferencing, type hinting, short array syntax, ...). | |
* |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |