Skip to content

Instantly share code, notes, and snippets.

View ramingar's full-sized avatar
:octocat:
Not a PRO user

Rafael Minguet ramingar

:octocat:
Not a PRO user
View GitHub Profile
@ramingar
ramingar / imagick-wamp-configuration.md
Last active February 26, 2024 00:05
Configurar ImageMagick con Wamp #php #imagick #wamp

Pasos:

  • https://pecl.php.net/package/imagick -> descarga la DLL que te interese de Imagick (la última, en la versión de PHP que te interese (5.6, thread safe (Apache), x64))
  • Del archivo descargado, copias todos los archivos que empiecen por CORE_ y los copias en C:\wamp64\bin\apache\apache2.4.27\bin
  • Del archivo descargado, copias el archivo php_imagick.dll en C:\wamp64\bin\php\php5.6.31\ext
  • Modificas el php.ini (tanto C:\wamp64\bin\apache\apache2.4.27\bin\php.ini como C:\wamp64\bin\php\php5.6.31\php.ini) y añades extension=php_imagick.dll en la sección de Dynamic Extensions
  • Reinicias el Wamp y lanzas el phpinfo() para buscar Imagick compiled with ImageMagick version y fijarnos en la versión de ImageMagick que necesitas instalar
  • Navegas a http://ftp.icm.edu.pl/packages/ImageMagick/binaries/, escoges descargar la versión que has visto antes y la *instalas en C:*
  • Vas a C:\ImageMagick-6.9.3-Q16\modules, y todos coders y filters se copian a la carpeta raíz de ImageMagick (si hubiesen
@ramingar
ramingar / git-commands.md
Last active February 19, 2024 11:20
Comandos git #git #definicion #concepts

git stash # Guarda los cambios actuales en "stash" y hace invisibles los cambios no comiteados

git stash pop # Rescata los cambios guardados en el stash y borra el stash

git stash apply # Hace lo mismo pero conserva el stash

git reset # Marca como unstaged todos lo que estaba staged (los devuelve al estado inicial de cambiado)

git reset HEAD@{1} # Elimina el último commit que tienes en local. Deja todo lo que llevaba ese commit en unstaged

@ramingar
ramingar / remove-git-credential-osxkeychain.md
Last active January 12, 2024 15:45
Remove git credential-osxkeychain #git #osx #credential
git config --global --edit

Eliminar dentro de la sección [credential] el helper = osxkeychain

En la terminal:

git config --local --unset credential.helper
@ramingar
ramingar / vue-debug-webstorm.md
Created December 12, 2018 11:00
Webstorm Vue Debugging #vue #debug #webstorm
@ramingar
ramingar / move-another-remote-repo.migrate
Last active October 23, 2022 23:09
Cambiar de un repo remoto git a otro moviendo todos los commits, tags, etc. #git #remote
# Info seen at: https://gist.github.com/maakor/8972566
#
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
@ramingar
ramingar / git-push-tags.md
Created January 12, 2018 09:10
Subir los tags al repositorio remoto #git #push #tags
git push --tags
@ramingar
ramingar / pack-objects-died-signal-9.md
Created January 27, 2020 13:45
error pack objects died signal 9 #git #error #commands
error: pack-objects died of signal 9
error: remote unpack failed: eof before pack header was fully read
error: failed to push some refs to 'user@server:url'

para solucionar este error:

git config --global pack.windowMemory "32m"
@ramingar
ramingar / revert-and-preserve-commits.md
Created April 29, 2022 09:17
Revert your repo to an older commit and preserve all intervening work #git #revert #preserve #master

Esto nos sirve para poder pushear un commit antiguo a una máquina de despliegue sin perder ninguno de los commits intermedios.

Source: https://stackoverflow.com/a/56710884

git checkout 307a5cd        # check out the commit that you want to reset to 
git checkout -b fixy        # create a branch named fixy to do the work
git merge -s ours master    # merge master's history without changing any files
git checkout master         # switch back to master
git merge fixy              # and merge in the fixed branch
@ramingar
ramingar / debug-android-from-pc
Created April 27, 2022 11:04
Debug Android Chrome Tabs from PC #adb #android #debug
- Conecta USB Debugging en android
- Conecta el móvil al pc por USB
- Instala adb (recomendado el adb de la página de android)
- Ejecuta `adb devices` (esto arranca y trata de enlazar con el dispositivo)
- En el pc ve a `chrome://inspect/#devices`
- Ahí debería aparecer tu móvil y el listado de tabs de chrome (del móvil)
Si el ordenador se conecta al dispositivo pero no ves las tabs de chrome, haz esto:
```
adb forward tcp:9222 localabstract:chrome_devtools_remote
@ramingar
ramingar / import-dumps.md
Created March 15, 2022 14:04
Import DUMPS a otra BBDD #mysql #import #continousdelivery

El script para importar los dumps es este:

#!/bin/sh

#USER=xxxxx
#PASS=xxxxx
#HOST=xxxxx

mysql --protocol=tcp --host=${​​​HOST}​​​ --user=${​​​USER}​​​ --password=${​​​PASS}​​​ --port=3306 --default-character-set=utf8 --comments --database=db1 < "${​​​PATH_TO_DUMPS}​​​/dump-db1.sql"