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" encoding="utf-8" ?> | |
| <phpunit> | |
| <testsuite name='Hello World Test Suite'> | |
| <directory suffix='.test.php'>./</directory> | |
| </testsuite> | |
| </phpunit> |
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 helloWorld() { | |
| return 'hello'; | |
| } | |
| use PHPUnit\Framework\TestCase; | |
| class HelloWorldTest extends TestCase { | |
| public function test_helloWorld_returns_value_as_expected() { | |
| $this->assertEquals('hello', helloWorld()); |
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 PHPUnit\Framework\TestCase; | |
| class HelloWorldTest extends TestCase { | |
| public function test_helloWorld_returns_value_as_expected() { | |
| $this->assertEquals('hello', helloWorld()); | |
| } | |
| } |
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 PHPUnit\Framework\TestCase; | |
| class HelloWorldTest extends TestCase {} |
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
| // remove sensitive data | |
| const hashData = (xs, y) => R.mapObjIndexed((x, key) => key.includes(y) ? '******' : x, xs); | |
| // tests | |
| describe('hashData', () => { | |
| it('should hash out sensitive information as expected', async () => { | |
| // given ... object that includes sensitive information | |
| const sensitiveObject = { | |
| username: 'john', | |
| password: 'my-super-secret-password', |
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
| http://learnyouahaskell.com | |
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
| Semi-Groups: | |
| - Type with a concat method (String, Integer e.t.c by default) | |
| e.g. "a".concat("b") | |
| Monoid: | |
| - Semi-group with special element that acts like a neutral identity (seen as a promotion) | |
| - e.g would be 0 in Sum (0.Sum(anything) is anything) | |
| - e.g would be "true" in All (true.All(anything) = is anything | |
| - e.g. true.concat(false) === false, true.concat(true) == true) | |
| - Some semi-groups cannot be promoted to monoids |
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
| const AWS = require('aws-sdk'); | |
| const uuid = require('uuid'); | |
| const client = new AWS.DynamoDB.DocumentClient(); | |
| modules.exports.run = async (event) => { | |
| const data = JSON.parse(event.body); | |
| const params = { | |
| TableName: "todos", | |
| Item: { |
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
| // given ... | |
| // when ... | |
| // then ... |
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
| ## https://www.udemy.com/understanding-typescript | |
| ## playground - https://www.typescriptlang.org/play/index.html | |
| ## `tsc script.ts` - compiles ts to js |