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 | |
class Format { | |
function __construct(){ | |
} | |
function query_if_varios_manejadores($nombreCampo, $valorCampo, $if_verdadero = 'NULL', $if_falso = 'NULL' , $manejador = 'sqlite'){ | |
if($manejador == "mysql") |
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
function botoneador($total_registros, $registros_por_pagina, $primer_registro){ | |
$registros_por_pagina = is_numeric($registros_por_pagina) && $registros_por_pagina != 0 ? $registros_por_pagina : 10; | |
$total_paginas = ceil($total_registros / $registros_por_pagina); | |
$primer_registro = is_numeric($primer_registro) ? number_format($primer_registro) : 0; | |
if($primer_registro < 0 || $primer_registro > $total_registros) | |
$primer_registro = 0; | |
$pagina_actual = floor($primer_registro / $registros_por_pagina) + 1; |
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
/* Create a file into the root directory of the project, and name it as "vue.config.js". Paste this code there. | |
*/ | |
module.exports = { | |
devServer: { | |
proxy: { | |
'/auth': { | |
target: 'http://127.0.0.1/api', // Sitio al que va a apuntar (redirigir) | |
pathRewrite: {'^/auth/': '/'} // Para que, por ejemplo, no busque "/auth" en el server de datos, si no la ruta que le pasemos acá | |
}, |
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
Note: need to improve gist and move it to MarkDown. | |
need to add how to add permissions to httpd.conf (in another gist) | |
Structure of the permissions in Linux: | |
For example, analyzing "-rwxr-xr--" | |
- rwx r-x r-- | |
[ Type of file ][Owner's permissions ][Group's permissions ][Other's permissions ] | |
| | 'r' = 'read' | | |
|'-' indicates file | 'w' = 'write' | | |
|'d' indicates directory | 'x' = 'execute' | |
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
/* Inicializar servidor */ | |
sudo systemctl start httpd.service | |
/* Parar servidor */ | |
sudo systemctl stop httpd.service | |
/* Inicializar servicio mariadb */ | |
sudo systemctl start mariadb.service | |
sudo systemctl enable mariadb.service |
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
/* @Lang: PHP | |
* @Description: Función para imprimir el valor y metadatos de una variable | |
*/ | |
function predump($var, $imprime=false, $salir=false){ | |
echo "<pre>"; | |
var_dump($var); | |
echo "</pre>"; | |
echo $imprime? $var : ""; | |
$salir? exit(): true; | |
} |
NewerOlder