apt-get update
apt-get install nano
export TERM=xterm
nano
.parent { | |
position: relative; | |
} | |
.child { | |
position: absolute; | |
top: 50%; | |
transform: translateY(-50%); | |
} |
$host = Drupal::request()->getSchemeAndHttpHost() . Drupal::request()->getBasePath();
echo $host;
El resultado:
Con base url https://www.example.com/subsite y la página https://www.example.com/subsite/news sería:
https://www.example.com/subsite
En postman pon `"?XDEBUG_SESSION_START=PHPSTORM"` | |
http://ecapy.com/debuguear-rest-con-postman-xdebug-phpstorm/index.html |
// Para que busque el template en el módulo. | |
/** | |
* Implements hook_theme(). | |
*/ | |
function modulename_theme($existing, $type, $theme, $path) { | |
$templates_path = $path . '/templates/'; | |
return [ | |
'node__content_type' => [ | |
// El base_hook en este caso es node. |
Ejemplo: m3u8
,
- Inspeccionar código e ir a las peticiones que llegan y copiar la url.
- Ejecutar:
$ ffmpeg -i "url.m3u8" -c copy v.ts
`composer.json:` | |
```json | |
{ | |
"autoload": { | |
"psr-4": { | |
"": "src/" | |
} | |
} | |
} |
In modern PHP, you're going to spend a lot of time working with other people's classes: via external libraries that you bring into your project to get things done faster. Of course, when you do that: you can't actually edit their code if you need to change or add some behavior.
Fortunately, OO code gives us some really neat ways to deal with this limitation. In this tutorial, you'll learn a method called composition in which we'll create a wrapper class, which has some subtle advantages over using inheritance.
https://symfonycasts.com/screencast/oo-ep4/composition-ftw
https://drive.google.com/file/d/1fTRmwiBB0cZzNQNYabM0SXUDErFIUaBk/view?usp=sharing
<?php | |
$query_string = preg_replace('/\}|\{/', '', $query->__toString()); | |
$arguments = $query->arguments(); | |
foreach ($arguments as $key => $val) { | |
$arguments[$key] = '\'' . $val . '\''; | |
} | |
$result_query = strtr($query_string, $arguments); |
SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC; |