symfony easyadmin instalacion

1) crear el proyecto de symfony

composer create-project symfony/framework-standard-edition my_project_name

2) descargar el bundle de migrations de doctrine

ir a la carpeta del proyecto creado

composer require doctrine/doctrine-migrations-bundle "^1.0"

3) habilitar el bundle en y setear parametros de configuracion

// app/AppKernel.php
public function registerBundles() {
$bundles = array(
//...
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), );
}

// app/config/config.yml

doctrine_migrations:
    dir_name: "%kernel.root_dir%/DoctrineMigrations"
    namespace: Application\Migrations
    table_name: migration_versions
    name: Application Migrations
    organize_migrations: false # Version >=1.2 Possible values are: "BY_YEAR", "BY_YEAR_AND_MONTH", false


4) descargar bundle de EasyAdmin

ir a la carpeta del proyecto creado

composer require javiereguiluz/easyadmin-bundle

5) habilitar el bundle

// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle(),
        );
    }

    // ...
}

6) setear las rutas del bundle

# app/config/routing.yml
easy_admin_bundle:
    resource: "@EasyAdminBundle/Controller/AdminController.php"
    type:     annotation
    prefix:   /admin

7) preparar web assets para los css/javascripts/fonts

php bin/console assets:install --symlink

8) crear las entidades del proyecto, por ejemplo Provincia y configurar su respectiva entrada

# app/config/config.yml
easy_admin:
    entities:
        Provincia:
            class: AppBundle\Entity\Provincia

9) habilitar el servicio de translator

# app/config/config.yml
framework:
    translator: { fallbacks: [ "en" ] }

10) listo, ya podemos acceder al admin

http://localhost:8181/symfosatsaid/web/app_dev.php/admin
























Git remover archivo del head (commit) y del stage(add)

Remove single file from staging or from commit


Sometimes we accidentally add a file to staging or commit it to git repo. Lets get to how to we can remove it in this tip.
Before going further with tip, lets revisits states in which file might exists,
  • Untracked - when you first create the file, it goes in this area
  • Staged/ index - when you use git add command on the file, it goes in this area
  • Committed - when you use the git commit on the file, it goes in this area
  • Modified- the file is committed but has the local changes which are not committed or staged yet.

Remove from staging area

To remove from staging, we can use following command-
git rm --cached <file_name>
Here, we are using the rm command along with switch --cached which indicates the file to be removed from the staging or cached area.
For example, we can use following command-
git rm --cached unwanted_file.txt

Remove single file from committed area

Note: In this, it is assumed, you doing it on local latest commit and not the commit which is pushed to remote repository.
Removing file from committed area requires 3 commands to be run, they are as follows-
git reset --soft HEAD^1
Above will undo the latest commit. if you do git status you will see files in the staging area. Now, we can easily remove it from staging area, as mentioned from previous point.
git rm --cached <file-name>
By running above command, the file will appear in the untracked file section.
Now, we removed the single file, lets commit back those remaining files-
git commit -m "<your-message>"
fuente

git resolver conflictos merge

Resolving a merge conflict using the command line

You can resolve merge conflicts using the command line and a text editor.
Merge conflicts may occur if competing changes are made to the same line of a file or when a file is deleted that another person is attempting to edit. For information on how to resolve these situations, see "Competing line change merge conflicts and "Removed file merge conflicts."

Competing line change merge conflicts

To resolve a merge conflict caused by competing line changes, you must choose which changes to incorporate from the different branches in a new commit.
For example, if you and another person both edited the file styleguide.md on the same lines in different branches of the same Git repository, you'll get a merge conflict error when you try to merge these branches. You must resolve this merge conflict with a new commit before you can merge these branches.
  1. Open Git Bash.
  2. Navigate into the local Git repository that has the merge conflict.
    cd REPOSITORY-NAME
    
  3. Generate a list of the files affected by the merge conflict. In this example, the file styleguide.mdhas a merge conflict.
    git status
    # On branch branch-b
    # You have unmerged paths.
    #   (fix conflicts and run "git commit")
    #
    # Unmerged paths:
    #   (use "git add ..." to mark resolution)
    #
    # both modified:      styleguide.md
    #
    no changes added to commit (use "git add" and/or "git commit -a")
    
  4. Open your favorite text editor, such as Atom, and navigate to the file that has merge conflicts.
  5. To see the beginning of the merge conflict in your file, search the file for the conflict marker <<<<<<<. When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line <<<<<<< HEAD. Next, you'll see =======, which divides your changes from the changes in the other branch, followed by >>>>>>> BRANCH-NAME. In this example, one person wrote "open an issue" in the base or HEAD branch and another person wrote "ask your question in IRC" in the compare branch or branch-a.
    If you have questions, please
    <<<<<<< HEAD
    open an issue
    =======
    ask your question in IRC.
    >>>>>>> branch-a
    
  6. Decide if you want to keep only your branch's changes, keep only the other branch's changes, or make a brand new change, which may incorporate changes from both branches. Delete the conflict markers <<<<<<<=======>>>>>>> and make the changes you want in the final merge. In this example, both changes are incorporated into the final merge:
    If you have questions, please open an issue or ask in our IRC channel if it's more urgent.
    
  7. Add or stage your changes.
    git add .
    
  8. Commit your changes with a comment.
    git commit -m "Resolved merge conflict by incorporating both suggestions."
    
You can now merge the branches on the command line or push your changes to your remote repositoryon GitHub and merge your changes in a pull request.

Removed file merge conflicts

To resolve a merge conflict caused by competing changes to a file, where a person deletes a file in one branch and another person edits the same file, you must choose whether to delete or keep the removed file in a new commit.
For example, if you edited a file, such as README.md, and another person removed the same file in another branch in the same Git repository, you'll get a merge conflict error when you try to merge these branches. You must resolve this merge conflict with a new commit before you can merge these branches.
  1. Open Git Bash.
  2. Navigate into the local Git repository that has the merge conflict.
    cd REPOSITORY-NAME
    
  3. Generate a list of the files affected by the merge conflict. In this example, the file README.mdhas a merge conflict.
    git status
    # On branch master
    # Your branch and 'origin/master' have diverged,
    # and have 1 and 2 different commits each, respectively.
    #  (use "git pull" to merge the remote branch into yours)
    # You have unmerged paths.
    #  (fix conflicts and run "git commit")
    #
    # Unmerged paths:
    #  (use "git add/rm ..." as appropriate to mark resolution)
    #
    #  deleted by us:   README.md
    #
    # no changes added to commit (use "git add" and/or "git commit -a")
    
  4. Open your favorite text editor, such as Atom, and navigate to the file that has merge conflicts.
  5. Decide if you want keep the removed file. You may want to view the latest changes made to the removed file in your text editor.
    To add the removed file back to your repository:
    git add README.md
    
    To remove this file from your repository:
    git rm README.md
    README.md: needs merge
    rm 'README.md'
    
  6. Commit your changes with a comment.
    git commit -m "Resolved merge conflict by keeping README.md file."
    [branch-d 6f89e49] Merge branch 'branch-c' into branch-d
    
You can now merge the branches on the command line or push your changes to your remote repositoryon GitHub and merge your changes in a pull request.

aumentar el tamaño de los archivos upload

en php.ini

upload_max_filesize=30M


programaticamente:

en el .htaccess

php_value post_max_size 30M
php_value upload_max_filesize 30M

instalar git en windows

 ir al sitio de descargas

https://git-scm.com/download/win

automaticamente se descargará el instalador correspondiente a tu sistema.

luego next next....

entrar a la consola bash creada y verificar la instalacion
tipeando el comando

git --version


pollo al horno con pure de papas


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');
}

arroz chaufa


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. 

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

linux ubuntu mint actualizar chrome

 desde una terminal: $ sudo apt update $ sudo apt install google-chrome-stable