Requires installed gitolite in /home/git and following directory structure
/var
/www
/apps
/hosts
/libs
| <?php | |
| $user = $connection->repository('user')->get(1); | |
| // $user instanceof Row | |
| $users = $connection->repository('user')->query()->where('id in ?', [1, 2, 3]); | |
| // $users instanceof SqlBuilder | |
| $users = $connection->repository('user')->query()->where('id in ?', [1, 2, 3])->getSelection(); | |
| // $users instanceof Selection |
| <?php | |
| class TestIterator implements \IteratorAggregate | |
| { | |
| public function getIterator() | |
| { | |
| return new ArrayIterator(array(1, 2, 3)); | |
| } | |
| } |
| <?php | |
| /** | |
| * signaly.cz - christian community platform | |
| * MIT license | |
| * | |
| * @link https://www.signaly.cz | |
| */ | |
| namespace Signaly; |
| <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> | |
| <?php | |
| function calculate_median($arr) { | |
| sort($arr); | |
| $count = count($arr); //total numbers in array | |
| $middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value | |
| if($count % 2) { // odd number, middle is the median | |
| $median = $arr[$middleval]; | |
| } else { // even number, calculate avg of 2 medians |
| <?php | |
| namespace model; | |
| use DateTime; | |
| use Nextras\Orm\Entity\Entity; | |
| /** | |
| * @property Salary[] $salaries {1:m SalariesRepository $employee} |
| namespace test; | |
| use Foo; | |
| $foo = new foo(); |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |