symfony migrations como saber si existe un indice, un campo o un foreign key
$tabla = $schema->getTable('usuario');
if (!$tabla->hasColumn('edad')) {
$tabla->addColumn('edad')->setNotnull(false);
}
if (!$tabla->hasIndex('nombre_idx')) {
$tabla->addIndex(['nombre'], 'nombre_idx');
}
if (!$tabla->hasForeignKey('FK_estado')) {
$tablaEstado = $schema->getTable('estado');
$tabla->addForeignKeyConstraint($tablaEstado,
['estado_id'],
['id'],
['onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'],
'FK_estado');
}
alargar la duracion de la bateria de celular Asus
1. Lower screen brightness
An overly bright screen consumes more power and can be harmful to the eye. To adjust brightness, swipe down from the notification bar twice and use the slider. Extend your battery life, and protect your eyes while doing so!

2. Shorten screen timeout time.
To squeeze more juice out of your battery, you can shorten the screen timeout time so that your phone goes into sleep mode faster. Try changing the time from the default 1 minute to 15 seconds.
To change this setting, tap Settings > Display > Sleep.
To change Cover View screen timeout time, go to Settings > ASUS Cover > Automatic sleep.

3. Trim unnecessary background apps.
Prevent unnecessary apps you don't need from running in the background and consuming your battery by using Auto-start Manager. Tap Auto-start Manager to select apps you want to discontinue from running.

4. Use Smart-saving Mode .
ZenFone 2 has many extremely useful battery modes, one of which is Smart-saving mode. It provides extra toggles for brightness, a feature that turns off internet, and an Extend Standby feature that lowers battery consumption by efficiently managing your push notifications when your phone is in sleep mode.
Tap Settings > Power management > Power Saver > Battery Modes > Smart-saving mode.

5. Tap Boost from Quick Settings.
Have you ever wished for a single button that solves all your problems? When you tap Boost, not only does it make your phone faster, but it also lowers battery consumption. Swipe down from the notification bar twice to find the Boost button.

6. Choose Wi-Fi over 3G/4G Data.
Using Wi-Fi instead of a data connection will use less battery because your phone doesn't need to constantly search for the network.
To turn on Wi-Fi, swipe down from the notification bar twice and tap the Wi-Fi icon.

7. Turn off Location Services, Bluetooth, and NFC.
Don't be lazy! Turning off these services when you're not using them can extend your battery life. To turn these services off, swipe down from the notification bar twice and tap the Location, Bluetooth, or NFC icon.
2. Shorten screen timeout time.
To squeeze more juice out of your battery, you can shorten the screen timeout time so that your phone goes into sleep mode faster. Try changing the time from the default 1 minute to 15 seconds.
To change this setting, tap Settings > Display > Sleep.
To change Cover View screen timeout time, go to Settings > ASUS Cover > Automatic sleep.
3. Trim unnecessary background apps.
Prevent unnecessary apps you don't need from running in the background and consuming your battery by using Auto-start Manager. Tap Auto-start Manager to select apps you want to discontinue from running.
4. Use Smart-saving Mode .
ZenFone 2 has many extremely useful battery modes, one of which is Smart-saving mode. It provides extra toggles for brightness, a feature that turns off internet, and an Extend Standby feature that lowers battery consumption by efficiently managing your push notifications when your phone is in sleep mode.
Tap Settings > Power management > Power Saver > Battery Modes > Smart-saving mode.
5. Tap Boost from Quick Settings.
Have you ever wished for a single button that solves all your problems? When you tap Boost, not only does it make your phone faster, but it also lowers battery consumption. Swipe down from the notification bar twice to find the Boost button.
6. Choose Wi-Fi over 3G/4G Data.
Using Wi-Fi instead of a data connection will use less battery because your phone doesn't need to constantly search for the network.
To turn on Wi-Fi, swipe down from the notification bar twice and tap the Wi-Fi icon.
7. Turn off Location Services, Bluetooth, and NFC.
Don't be lazy! Turning off these services when you're not using them can extend your battery life. To turn these services off, swipe down from the notification bar twice and tap the Location, Bluetooth, or NFC icon.
8. Set up an Auto-switch mode schedule.
You can't be using your phone all the time! Set up a time interval in Auto-switch mode to automatically switch to a lower battery consumption power mode when you're not using it. To do this, tap Settings > Power management > Power Saver > Auto-switch mode. After enabling this feature and choosing your starting and ending times, we recommend setting it to change to Ultra-saving mode (the default).
Last but not least, don't forget to pick up a ZenPower (From select resellers or at http://store.asus.com/us if located in North America) for all your charging needs when you're on-the-go! Fast and convenient charging available at your fingertips, whenever, wherever.
- Product ASUS ZenFone 2 (ZE551ML), ASUS ZenFone 2E (ZE500CL AT&T)
- Category Power/ Battery
- Type Product Knowledge
symfony 3.3 clear cache
el clásico
php app/console cache:clear --env=prod
ya no funciona.
ahora hay que usar
php app/console cache:clear --no-warmup --env=prod
(con esa linea basta, pero en la documentacion dicen de tambien ejecutar la sgt:
php bin/console cache:warmup --env=prod
)
php app/console cache:clear --env=prod
ya no funciona.
ahora hay que usar
php app/console cache:clear --no-warmup --env=prod
(con esa linea basta, pero en la documentacion dicen de tambien ejecutar la sgt:
php bin/console cache:warmup --env=prod
)
activa internet chip personal argentina
Personal Argentina :
Estos son los pasos para configurar los APN en dispositivos con Android.
Pasos:
1. Buscar en el menú de Ajustes (Configuración) la opción “APN”. Esta puede variar de ubicación según el equipo. En Android 4.4 se encuentra en Ajustes > Más… > Redes móviles > APN
2. Presionar el botón de menú y seleccionar ‘APN nuevo’ e ingresar los siguientes datos:
- Nombre: Personal Datos
- APN: datos.personal.com
- Proxy: No definido
- Puerto: No definido
- Nombre de usuario: datos
- Contraseña: datos
- Servidor: No definido
- MMSC: No definido
- Proxy de MMS: No definido
- Puerto MMS: No definido
- MCC: 722
- MNC: 34
- Tipo de autenticación: PAP
- Tipo de APN: default, supl
- Protocolo APN: IPv4
- Activar/desactivar APN: habilitado
- Portadora: sin especificar
3. Presionar el botón de menú y seleccionar ‘Guardar’
4. Presionar nuevamente el botón de menú y seleccionar ‘APN nuevo’ e ingresar los siguientes datos:
- Nombre: Personal
- APN: mms
- Proxy: No definido
- Puerto: No definido
- Nombre de usuario: mms
- Contraseña: mms
- Servidor: No definido
- MMSC: http://mms.personal.com/
- Proxy de MMS: 172.25.7.31
- Puerto MMS: 8080
- MCC: 722
- MNC: 34
- Tipo de autenticación: PAP
- Tipo de APN: mms
- Activar/desactivar APN: habilitado
- Portadora: sin especificar
5. Presionar el botón de menú y seleccionar ‘Guardar’
symfony 3 eventos
se necesita
1. Creamos nuestro controlador y la vista - en el action llamamos al listener
2. Creamos nuestra clase - la que será observada
3. Creamos nuestra clase Evento - la que marca a la clase como observada
4. Creamos nuestra clase Listener - implementa los metodos a llamar segun cada evento
5. Registramos el Evento como un servicio - esto lo hacemos en el archivo de configuracion services.yml
el controlador
class PruebaController extends Controller
{
/**
* @Route("/prueba/prueba1", name="prueba1")
*/
public function prueba1Action() {
$prueba=new Prueba();
$pruebaEvent = new PruebaEvent($prueba);
$this->container->get('event_dispatcher')->dispatch('prueba.event.uno',
$pruebaEvent);
return $this->render('default/index.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,
]);
}
}
nota:
para el ejemplo estoy llamando al action desde una opcion de menú
<ul class="nav navbar-nav">
<li><a href="{{ path('prueba1') }}">prueba1</a></li>
</ul>
la clase
class Prueba {
private $nombre;
public function getNombre(){
return $this->nombre;
}
public function setNombre($nombre){
$this->nombre=$nombre;
}
}
la clase evento
namespace AppBundle\Event;
class PruebaEvent extends Event {
private $prueba;
public function __construct(Prueba $prueba) {
$this->prueba = $prueba;
}
public function getPrueba(){
return $this->prueba;
}
}
el listener:
namespace AppBundle\EventListener;
class PruebaListener {
private $requestStack;
public function __construct(\Symfony\Component\HttpFoundation\RequestStack $requestStack) {
$this->requestStack = $requestStack;
}
public function onModificarUno (\AppBundle\Event\PruebaEvent $pruebaEvent)
{
$request=$this->requestStack->getCurrentRequest();
$session=$request->getSession();
$session->getFlashBag()->add("success","onModificarUno!");
}
}
el registro del servicio:
services:
app.prueba.listener:
class: AppBundle\EventListener\PruebaListener
arguments: ['@request_stack']
tags:
- { name: kernel.event_listener, event: prueba.event.uno, method: onModificarUno }
p.d: si hubiesen mas métodos, se deben agregar mas lineas en tag por cada uno de ellos
- { name: kernel.event_listener, event: prueba.event.dos, method: onModificarDos }
1. Creamos nuestro controlador y la vista - en el action llamamos al listener
2. Creamos nuestra clase - la que será observada
3. Creamos nuestra clase Evento - la que marca a la clase como observada
4. Creamos nuestra clase Listener - implementa los metodos a llamar segun cada evento
5. Registramos el Evento como un servicio - esto lo hacemos en el archivo de configuracion services.yml
el controlador
class PruebaController extends Controller
{
/**
* @Route("/prueba/prueba1", name="prueba1")
*/
public function prueba1Action() {
$prueba=new Prueba();
$pruebaEvent = new PruebaEvent($prueba);
$this->container->get('event_dispatcher')->dispatch('prueba.event.uno',
$pruebaEvent);
return $this->render('default/index.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,
]);
}
}
nota:
para el ejemplo estoy llamando al action desde una opcion de menú
<ul class="nav navbar-nav">
<li><a href="{{ path('prueba1') }}">prueba1</a></li>
</ul>
la clase
class Prueba {
private $nombre;
public function getNombre(){
return $this->nombre;
}
public function setNombre($nombre){
$this->nombre=$nombre;
}
}
la clase evento
namespace AppBundle\Event;
class PruebaEvent extends Event {
private $prueba;
public function __construct(Prueba $prueba) {
$this->prueba = $prueba;
}
public function getPrueba(){
return $this->prueba;
}
}
el listener:
namespace AppBundle\EventListener;
class PruebaListener {
private $requestStack;
public function __construct(\Symfony\Component\HttpFoundation\RequestStack $requestStack) {
$this->requestStack = $requestStack;
}
public function onModificarUno (\AppBundle\Event\PruebaEvent $pruebaEvent)
{
$request=$this->requestStack->getCurrentRequest();
$session=$request->getSession();
$session->getFlashBag()->add("success","onModificarUno!");
}
}
el registro del servicio:
services:
app.prueba.listener:
class: AppBundle\EventListener\PruebaListener
arguments: ['@request_stack']
tags:
- { name: kernel.event_listener, event: prueba.event.uno, method: onModificarUno }
p.d: si hubiesen mas métodos, se deben agregar mas lineas en tag por cada uno de ellos
- { name: kernel.event_listener, event: prueba.event.dos, method: onModificarDos }
Suscribirse a:
Entradas (Atom)
linux ubuntu mint actualizar chrome
desde una terminal: $ sudo apt update $ sudo apt install google-chrome-stable
-
Vamos a crear un proyecto llamado SpringBoot01 para esto, -creamos un proyecto maven y configuramos el build path como vimos en el tutoria...
-
por consola y desde la raiz de tu proyecto php artisan --version
-
abrir una consola en la carpeta root de tu proyecto php app/console --version o php bin/console --version