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 App\Model\Behavior; | |
use Cake\Datasource\EntityInterface; | |
use Cake\Event\Event; | |
use Cake\ORM\Behavior; | |
use Cake\Utility\Inflector; | |
use Cake\ORM\Table; | |
/** |
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 App\Model\Behavior; | |
use Cake\Datasource\EntityInterface; | |
use Cake\Event\Event; | |
use Cake\Log\Log; | |
use Cake\ORM\Behavior; | |
use Cake\ORM\Table; | |
/** |
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 | |
/** | |
* importer for CSV in MySQL DB. | |
* pleas keep tje CSV file in the same directory and run : | |
* | |
* > php ./import.php | |
*/ | |
$host = "localhost"; // Host name. | |
$db_user = "root"; //mysql user |
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
/** | |
* Problem Statement: | |
* | |
* A vending machine has the following denominations: 1c, 5c, 10c, 25c, 50c, and $1. | |
* Your task is to write a program that will be used in a vending machine to return change. | |
* Assume that the vending machine will always want to return the least number of coins or notes. | |
* Devise a function getChange (M, P) | |
* where M is how much money was inserted into the machine and P the price of the item selected, | |
* that returns an array of integers representing the number of each denomination to return. | |
* |
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 | |
/** | |
* * Problem Statement: | |
* * passing a floating point number to a function, the function will round the number to | |
* * the nearest point five and return the result. | |
* | |
* * Example: | |
* * roundUpToNextFive(3.7) // returns 4.0 | |
* * roundUpToNextFive(3.3) // returns 3.5 |
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
class EditorJs | |
{ | |
/* | |
* third party plugins: | |
* - youtubeEmbed (https://github.com/yuanwei92/editorjs-youtube-embed) | |
* - inline image (https://www.npmjs.com/package/editorjs-inline-image) | |
* */ | |
public function parse($content): string | |
{ |