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 | |
| describe('StringCalculator', function () { | |
| it('requires string output', function () { | |
| $this->shouldThrow('\InvalidArgumentException')->during('add', [null]); | |
| }); | |
| it('adds 2 numbers separated by comma', function () { | |
| $this->add('1,2')->shouldReturn(3); |
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
| and(A, A, A). | |
| and(A, B, 0) :- A \= B. | |
| or(1, 0, 1). | |
| or(0, 1, 1). | |
| or(1, 1, 1). | |
| or(0, 0, 0). | |
| xor(1, 0, 1). | |
| xor(0, 1, 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
| <?hh | |
| /*-------------------------*\ | |
| PROGRAMMING | |
| WITH | |
| NOTHING | |
| \*-------------------------*/ | |
| /* | |
| * A heavily based on http://codon.com/programming-with-nothing | |
| */ |
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
| default: | |
| suites: | |
| portal: | |
| contexts: [Behat\MinkExtension\Context\MinkContext, PortalContext] | |
| path: %paths.base%/features | |
| extensions: | |
| Behat\MinkExtension: | |
| base_url: http://st3hoekcp-acc.wonenportaal.nl/ | |
| sessions: | |
| default: |
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
| { | |
| "require": { | |
| "behat/mink-goutte-driver": "~1.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
| <?xml version="1.0" ?> | |
| <xliff version='1.1' xmlns='urn:oasis:names:tc:xliff:document:1.1'> | |
| <file original='NoName' source-language='en' datatype='plaintext'> | |
| <body> | |
| <!-- In Symfony --> | |
| <trans-unit id="apples"> | |
| <source>I have %number% apples</source> | |
| <target>{0} I have no apples|{1} I have one apple|]1,Inf] I have %count% apples</target> | |
| </trans-unit> | |
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 SiteController extends Controller | |
| { | |
| public function searchAction(Request $request) | |
| { | |
| $query = $request->query->get('query'); | |
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
| import Data.List (groupBy, sortBy) | |
| getQuantity xs = let countQuantity acc (_, "registered") = succ acc | |
| countQuantity acc (_, "sold") = pred acc | |
| compareASC (i1, _) (i2, _) | |
| | i1 < i2 = LT | |
| | i1 > i2 = GT | |
| | i1 == i2 = EQ | |
| in map (foldl (countQuantity) 0) $ groupBy (\x y -> (fst x) == (fst y)) $ sortBy (compareASC) xs | |
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 | |
| // BEFORE | |
| // ... | |
| class FeatureContext | |
| { | |
| public function assertFieldHasErrorMessage($message, $locator) | |
| { | |
| // find fieldset by locator for field |
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 | |
| $response = new \Response(); | |
| try { | |
| $client->buy('sofa'); | |
| } catch (\Exception $e) { | |
| foreach ($this->exceptionHandlers as $handler) { | |
| if ($handler->accepts($e)) { | |
| $response = $handler->handle($e, $response); |