Skip to content

Instantly share code, notes, and snippets.

View jaimeivan's full-sized avatar
🏠
Working from home

Jaime Ivan jaimeivan

🏠
Working from home
View GitHub Profile
@jaimeivan
jaimeivan / Windows :: Commands.md
Created April 17, 2023 16:17
Windows :: Commands

Marca el siguiente error al tratar de ejecutar npm install

npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

Ejecutar desde powershell

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
@jaimeivan
jaimeivan / osx_terminal_commands.md
Last active December 2, 2023 18:20
Comandos para la terminal de OSx

Para renombrar ardchivos de un directorio a minúsculas

for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done

Ver que proceso está ocupando cierto puerto

ref: https://stackoverflow.com/a/4421674/2499084

sudo lsof -nP -iTCP:[puerto] | grep LISTEN
@jaimeivan
jaimeivan / querys.md
Last active April 3, 2018 11:08
MySQL

Search for a text string in a field and replace it

UPDATE [table_name]
   SET [field_name] = REPLACE([field_name],'[string_search]','[string_replace]')
 WHERE INSTR([field_name], '[string_search')
@jaimeivan
jaimeivan / migx-tv-cmp.md
Last active February 12, 2018 10:18
Tips & Chips de ModX

Generic badge

Usar MIGX con una base de datos y TV's

  1. Se debe tener instalado el paquete MIGX
  2. Se crea una TV en Elements > Template Variables
  • General Information
    • Name : [base_name]
  • Input Options
    • Input Type : migx
    • Congfigurations : [base_name]
@jaimeivan
jaimeivan / console-browser.md
Last active December 27, 2017 01:05
Comándos útiles en la consola del navegador

Inyectar JQuery

var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict();
@jaimeivan
jaimeivan / mount-hfsplus-linux.md
Last active January 8, 2017 10:44
Montar disco externo con sistema de archivos OSX plus ( aka hfsplus) en linux

1 : Deshabiliar el Journal temporalmente en el disco duro desde OSX

En una terminal de OSX, para conocer el nombre del volumen:

diskutil list

Ya con el nombre:

@jaimeivan
jaimeivan / emmet.md
Last active December 21, 2016 11:21
Sublime tricks

##Emmet : Wrap with abreviation ###Wrap controlling positiion

Op1
Op2
Op3
@jaimeivan
jaimeivan / MM_openBrWindow.md
Last active August 29, 2015 14:01
Expresiones regulares probadas en el Sublime2

Busca lo que tenga en el href el script de Dream Weaver MM_openBrWindow y sólo deja el url


De:

<a href="javascript:MM_openBrWindow('http://your.site.com','nueva-vetana','scrollbars=yes,resizable=yes,width=720,height=400')">Tu sitio .com</a>

a:

<a href="http://your.site.com">Tu sitio .com</a>
@jaimeivan
jaimeivan / linux :: Commands.md
Last active October 27, 2023 15:34
Comándos útiles en linux

Calcular el número de archivos de forma recursiva

ls -R [directorio] | wc -l

Listado de archivos con el tamaño en MB

ls -la --block-size=MB
@jaimeivan
jaimeivan / Git :: Commands.md
Last active January 29, 2024 02:58
Para usar Git desde la ventana de comandos

Clonar repositorio

$ git clone [url]

Para meter y sacar todos los elementos al stash

$ git stash
$ git stash pop
$ git stash save "mensaje"