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
#!/bin/bash | |
# get all open PR numbers that have master as base | |
PRS=`gh pr list --state open --base master | cat | cut -f 1` | |
for PR_ID in $PRS; do | |
echo "PR: $PR_ID" | |
# Migrate pull-request to main branch |
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
// original | |
if ($scope.person.surname == '' || $scope.person.firstname == '') { | |
return true; | |
} | |
return false; | |
// simplifiziert | |
return !!($scope.person.surname == '' || $scope.person.firstname == ''); |
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 | |
public function myPageAction(Request $request) | |
{ | |
$locale = $request->getLocale(); | |
} |
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 | |
$elementalSystem = new NumberSystem(['earth', 'fire', 'air', 'water']); | |
$binarySystem = new NumberSystem(['0', '1']); | |
$number = new Number('fire-fire-earth-air', $elementalSystem, '-'); | |
echo $number->asDecimalString(); // -> 214 | |
$number->convert($binarySystem)->value() // -> 11010110 |
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 | |
/** | |
* Pijib | |
* PHP interprets Javascript interprets Brainfuck | |
* | |
* This is an awesome script that takes brainfuck-code that | |
* will be interpreted by Kit's JavaScript Brainfuck Interpeter that will be interpreted by PHP | |
* | |
*/ |
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 fooTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testBar() | |
{ | |
$builder = $this->getMockBuilder('SomeDoctrineRecordClass')->disableOriginalConstructor(); | |
$mockObject = $builder->getMock(); | |
$mockObject->expects($this->any()) | |
->method('__call') |
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 fooTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testBar() | |
{ | |
$builder = $this->getMockBuilder('SomeDoctrineRecordClass')->disableOriginalConstructor(); | |
$mockObject = $builder->getMock(); | |
$mockObject->expects($this->any()) | |
->method('getProperty') |
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
#!/bin/bash | |
pear update-channels # updates channel definitions | |
pear upgrade --alldeps # upgrades all existing packages and pear | |
pear channel-discover components.ez.no # this is needed for PHPUnit | |
pear channel-discover pear.symfony-project.com # also needed by PHPUnit | |
pear channel-discover pear.phpunit.de # This IS phpunit | |
pear install --alldeps phpunit/PHPUnit # installs PHPUnit and all dependencies | |
phpunit --version # should display something above: 3.6.x |
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 | |
$object = ObjectQuery::create()->findOneById(1); | |
// load blob content | |
$content = stream_get_content($object->getImage()); | |
// content now holds the image data | |
var_dump($content); |