Skip to content

Instantly share code, notes, and snippets.

View jorgecc's full-sized avatar
🏠
Working from home

Jorge Castro jorgecc

🏠
Working from home
View GitHub Profile
@jorgecc
jorgecc / firstable.csv
Last active September 27, 2018 00:15
First table, it is an exercise of https://github.com/eftec/daoone
idproduct name type id_category
1 cocacola drink 1
2 fanta drink 1
3 sprite drink 1
4 iphone phone 2
5 galaxy note phone 2
6 xiami phone 2
7 volvo car 3
8 bmw car 3
@jorgecc
jorgecc / jointable.csv
Created September 27, 2018 00:27
First table, it is an exercise of https://github.com/eftec/daoone
idproduct name type id_category catname
1 cocacola drink 1 cheap
2 fanta drink 1 cheap
3 sprite drink 1 cheap
4 iphone phone 2 normal
5 galaxy note phone 2 normal
6 xiami phone 2 normal
7 volvo car 3 expensive
8 bmw car 3 expensive
@jorgecc
jorgecc / jointablev2.csv
Created September 27, 2018 00:30
Join table v2, it is an exercise of https://github.com/eftec/daoone
name type catname
cocacola drink cheap
fanta drink cheap
sprite drink cheap
iphone phone normal
galaxy note phone normal
xiami phone normal
volvo car expensive
bmw car expensive
@jorgecc
jorgecc / joinandsort.csv
Created September 27, 2018 00:31
Join and sort, it is an exercise of https://github.com/eftec/daoone
name type catname
bmw car expensive
cocacola drink cheap
fanta drink cheap
galaxy note phone normal
iphone phone normal
sprite drink cheap
volvo car expensive
xiami phone normal
@jorgecc
jorgecc / unique.csv
Last active September 27, 2018 00:35
Unique table, it is an exercise of https://github.com/eftec/daoone
name type catname
cocacola drink cheap
@jorgecc
jorgecc / group.csv
Last active September 27, 2018 00:46
Group table, it is an exercise of https://github.com/eftec/daoone
catname count
cheap 3
normal 3
expensive 2
@jorgecc
jorgecc / injection1.php
Last active October 4, 2018 00:32
DI Example 1
<?php
class ClassConvertMoneyWithoutInjection
{
function conversor($value)
{
return $value*1.15;
}
public function example($money) {
echo "$money is converted in ".$this->conversor($money)."<br>";
}
@jorgecc
jorgecc / injection2.php
Created October 4, 2018 00:33
Example of Dependency Injection
<?php
class ClassConvertMoneyWithInjection
{
/** @var IConversor */
public $service;
public function setService(IConversor $srv) {
$this->service=$srv;
}
public function example($money) {
echo "$money is converted in ".$this->service->conversor($money)."<br>";
@jorgecc
jorgecc / injection3.php
Created October 4, 2018 00:38
Example of DI
<?php
$obj=new ClassConvertMoneyWithInjection();
echo "converting 300 dollars to euro:<br>";
$obj->setService(new ServiceDollarToEuro());
$obj->example(300);
echo "converting 300 euros to dollar:<br>";
$obj->setService(new ServiceEuroToDollar());
$obj->example(300);
<input type="number" name="frm_price" class="form-control" placeholder="Price" value="{{$product['price']}}">