Skip to content

Instantly share code, notes, and snippets.

View rpayanm's full-sized avatar

Rolando rpayanm

View GitHub Profile
apt-get update
apt-get install nano
export TERM=xterm
nano
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
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,

  1. Inspeccionar código e ir a las peticiones que llegan y copiar la url.
  2. Ejecutar: $ ffmpeg -i "url.m3u8" -c copy v.ts
`composer.json:`
```json
{
"autoload": {
"psr-4": {
"": "src/"
}
}
}

Object Composition (Sobrescribir una clase sin editarla)

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;