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 | |
function sortString($a, $b) { | |
return strcmp($a, $b); | |
} | |
function sortNumber($a, $b) { | |
return r_num_get(NULL, $a) - r_num_get(NULL, $b); | |
} | |
class RTableColumnType { |
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
default: | |
formatters: | |
pretty: | |
verbose: true | |
paths: false | |
snippets: true | |
suites: | |
default: | |
contexts: | |
- FeatureContext |
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 | |
$to_one = function($name){ | |
echo "Hola $name \n\r"; | |
}; | |
$to_many = function($arr) use ($to_one) { | |
return array_map($to_one, $arr); | |
}; |
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 | |
$obj_1 = new StdClass; | |
$obj_1->name = "Toby"; | |
$obj_2 = new StdClass; | |
$obj_2->name ="Martha"; | |
$obj_3 = new StdClass; | |
$obj_3->n = 5; | |
$ar1 = ['name'=> 'Paul']; | |
$ar2 = ['name'=> 'Jess']; | |
$ar3 = ['age'=> '19']; |
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 Acme\Leandro; | |
class Saludo { | |
public function __invoke($name){ | |
echo "Hola $name !!"; | |
} | |
} |
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 | |
$discount = function($percent){ | |
return function($price) use ($percent){ | |
return ($price - ($price * $percent * 0.01)); | |
}; | |
}; | |
$half_off = $discount(50); | |
echo $half_off(500); |
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 | |
// © [email protected] 20190504 | |
// | |
$battle_url = "https://www.mythereum.io/api/games/"; | |
$player_url = "https://mythereum.io/api/players/"; | |
$my_print= function($txt){ | |
echo "$txt\n"; | |
}; |
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
#!/bin/bash | |
cd /Users/leandro/docker/madriddigital-hospitales/ | |
docker-compose stop | |
git pull --ff-only | |
docker-compose up -d --build | |
docker-compose exec php composer install -o | |
docker-compose exec php vendor/bin/drush cim | |
docker-compose exec php vendor/bin/drush entup | |
docker-compose exec php vendor/bin/drush updb |
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 | |
$head = function($a) { | |
return array_shift($a); | |
}; | |
$tail = function($a) { | |
$first = array_shift($a); | |
return $a; | |
}; |
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 | |
$file = "/Users/leandro/.console/version"; | |
$saved_version = "0"; | |
$saved_date = ""; | |
if (file_exists($file)){ | |
$fp = fopen($file, 'r'); | |
list($saved_date, $saved_version) = explode("|", @fread($fp, filesize($file))); | |
} |
NewerOlder