sábado, 1 de julio de 2017

Eliminar los espacios en blanco al guardar en Sublime Text 3 - tabulacion basada en expacios

Eliminar los espacios en blanco al guardar en Sublime Text 3 - tabulacion basada en expacios

Una cosa que siempre me pone de los nervios es la gente que deja espacios en blanco al final de las líneas cuando programa. Por suerte los que usamos Sublime Text 2 para programar, tenemos una fácil solución.
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"theme": "Numix Dark.sublime-theme",
"font_size": 10,
"highlight_line": true,
"save_on_focus_lost": true,
"translate_tabs_to_spaces": false,
"trim_trailing_white_space_on_save": true,

     // tabulacion basada en espacios
    // The number of spaces a tab is considered equal to
    "tab_size": 2,
   
    // Set to true to insert spaces when tab is pressed
    "translate_tabs_to_spaces": true,

    // If translate_tabs_to_spaces is true, use_tab_stops will make tab and
    // backspace insert/delete up to the next tabstop
    "use_tab_stops": false,
}


jueves, 18 de mayo de 2017

git clone all branches

git clone all branches

You can fetch one branch from all remotes like this:

git fetch --all
fetch updates local copies of remote branches so this is always safe for your local branches BUT:

fetch will not update local branches (which track remote branches); If you want to update your local branches you still need to pull every branch.
fetch will not create local branches (which track remote branches), you have to do this manually. If you want to list all remote branches: git branch -a
To update local branches which track remote branches:

git pull --all
However, this can be still insufficient. It will work only for your local branches which track remote branches. To track all remote branches execute this oneliner BEFORE git pull --all:

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done

viernes, 12 de mayo de 2017

Commands Service NgInx

Commands  Service NgInx
The same commands can be used to start / stop / restart the nginx server on a Ubuntu Linux:
sudo systemctl start nginx 
sudo systemctl stop nginx 
sudo systemctl restart nginx
OR
sudo service nginx start
sudo service nginx stop
sudo service nginx restart
OR
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart

jueves, 13 de abril de 2017

Ocultar Archivos y Carpetas en Sublime Text 3



Ocultar Archivos y Carpetas en Sublime Text 3  

Ir al Menu Project -> save project as...  
Guardaras el proyecto de sublime(puedes moverlos donde tu desees )


{
 "folders": [
{
"folder_exclude_patterns": [
"node_modules",
],
"path": "/opt/lampp/htdocs/erp/demo-cli",
"file_exclude_patterns": [
"*.js",
"*.map",
]
}
 ]
}


referencia
https://marcjenkins.co.uk/hiding-files-and-directories-in-a-sublime-text-project/

Sublime Text 3 Refresh Folder

Sublime Text 3 Refresh Folder 


  1. Open Sublime Text.
  2. Select Preferences from the top menu and click Key Bindings – User.
  3. Add the following entry between the brackets.
// Refresh folder list with F5
"keys": ["f5"], "command""refresh_folder_list" }
You should be able to refresh the folders with F5.

martes, 4 de abril de 2017

Activar Driver PDO con XAMPP o servidores APACHE

Activar Driver PDO con XAMPP o servidores APACHE 

1. Verificar las extensiones de PDO activadas
php -i|grep PDO


2. Descomentar las librerias pdo para el driver que se va utilizar(MYSQL, PGSQL, ec) del archivo PHP.INI
sudo nano /opt/lampp/etc/php.ini 

si no utilizas xampp utliza la ruta de tu php.ini

utilizando GEDIT
sudo gedit /opt/lampp/etc/php.ini
   
# mysql
extension=php_pdo_mysql.dll

# Posgress
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll


algo asi

3. instalar el driver
-activar para postgress
sudo apt-get install php7.0-pgsql

-activar para mysql
sudo apt-get install php7.0-mysql