This file contains hidden or 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
1. Para ver si mongodb est谩 disponible en los modulos de php ejecutamos esto en consola | |
~ /usr/bin/env php -m | |
2. Instalaci贸n de dependencias para el drive de mongo | |
sudo apt-get update | |
sudo pecl install mongo | |
3. Modifico 1ero el php.ini del apache | |
~ sudo vi /etc/php5/apache2/php.ini |
This file contains hidden or 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
Zend Framework 2 Tool | |
========================= | |
**ZFTool** instalar dentro de las dependencias del proyecto Zend Framework 2 . | |
## Configurar la instalaci贸n | |
* Run `composer require zendframework/zftool:dev-master` | |
* Habilitar el modulo ZFTool en **application.config.php** | |
## Features |
This file contains hidden or 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
www=/home/putencio/Proyectos/wp | |
echo "Ingrese el dominio local" | |
read sn | |
# Create VirtualHost config in /etc/apache2/site-available/ | |
echo "<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName $sn | |
This file contains hidden or 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
echo "Ingrese el dominio local" | |
read sn | |
echo "ingrese el directorio del proyecto" | |
read www | |
echo "ingrese el repo a clonar" | |
read clone | |
echo "Creando el VirtualHost" |
This file contains hidden or 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 limit_words($string, $word_limit) { | |
$words = explode(' ', $string); | |
return implode(' ', array_slice($words, 0, $word_limit)); | |
} |
This file contains hidden or 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 addHttp($url) { | |
if (filter_var($url, FILTER_VALIDATE_URL) === false) { | |
$url = "http://" . $url; | |
} | |
return $url; | |
} |
This file contains hidden or 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 cortarTexto($txt, $nr, $abrev = null) { | |
$tamano = $nr; | |
$contador = 0; | |
$texto = strip_tags($txt); | |
if ($texto != "") { // Cortamos la cadena por los espacios | |
//$arrayTexto = split(' ',$texto); | |
if ($tamano >= strlen($texto)) { | |
return $texto; | |
} else { | |
$arrayTexto = explode(' ', $texto); |
This file contains hidden or 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
// Requerir imagen destacada | |
add_action('save_post', 'wpds_check_thumbnail'); | |
add_action('admin_notices', 'wpds_thumbnail_error'); | |
function wpds_check_thumbnail($post_id) { | |
// cambia esto para cualquier tipo de entrada personalizada | |
if (get_post_type($post_id) != 'post') | |
return; | |
if (!has_post_thumbnail($post_id)) { | |
// se muestra un mensaje a los usuarios |
This file contains hidden or 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 bloqueo_images_pequenas($file) { | |
$type = explode('/', $file['type']); | |
if ($type[0] == 'image') { | |
list( $width, $height, $imagetype, $hwstring, $mime, $rgb_r_cmyk, $bit ) = getimagesize($file['tmp_name']); | |
if ($width < 600 && $height < 400) { | |
$file['error'] = __('ERROR: La imagen no cumple con las dimensiones minimas de 600x400- ancho act:' . $width . ' alto act:' . $height, 'textdomain'); | |
} | |
} | |
return $file; | |
} |
This file contains hidden or 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
Pasos para crear un usuario ftp en linux: | |
0.- sudo apt-get install vsftpd | |
1.- ir al directorio | |
cd /home/ftp | |
2.- crear directorio "user" | |
mkdir user | |
3.- agregar el usuario user | |
sudo useradd user -d / -s /bin/ftp | |
4.- asignarle password | |
sudo passwd user |