Skip to content

Instantly share code, notes, and snippets.

View wlizama's full-sized avatar
💻
Making amazing things 🔣

Wilder Lizama wlizama

💻
Making amazing things 🔣
View GitHub Profile
@wlizama
wlizama / revert-merge-commit.sh
Created January 12, 2024 16:49
Revert merge commit
# ensure you are on the correct branch where the merge commit needs to be undone
git checkout main
# find the hash of the merge commit that you want to undo
git log
# Use git revert with the -m option followed by the commit hash to revert the
# merge commit. The -m option specifies the mainline parent, which is usually the branch you merged into
git revert -m 1 <merge_commit_hash>
function solution(inputString) {
for(let i = 0; i < inputString.length / 2; i++) {
if (inputString[i] != inputString[inputString.length - i - 1 ])
return false;
}
return true
}
@wlizama
wlizama / merge_commit_files_changed.sh
Created September 15, 2020 23:18
Ver archivos cambiados en un merge commit
git log -m -1 --name-only --pretty="format:" commit_id_here
docker ps
# f43a902fdef agitated_bassi
docker exec -it f43a902fdef bash
# detener todos los contenedores
for a in `docker ps -a -q`
do
echo "Stopping container - $a"
docker stop $a
done
@wlizama
wlizama / useComponentWillMount.js
Created June 4, 2020 23:26
hook alternative to ComponentWillMount lifecycle method
import React, { useRef, useEffect } from 'react';
const useComponentWillMount = func => {
const willMount = useRef(true);
useEffect(() => {
willMount.current = false;
}, []);
if (willMount.current) { func(); }
@wlizama
wlizama / timeshift_install.sh
Created February 27, 2020 22:56
timeshift install
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt update
sudo apt install timeshift
@wlizama
wlizama / mount_drives.sh
Created February 27, 2020 22:56
montar unidades Linux
sudo mount.cifs //172.19.39.33/d$ /mnt/servers/33-D -o user=admin,pass='my_super_password'
@wlizama
wlizama / ascii_str.py
Created November 8, 2019 20:34
Crear una cadena ascii con los caracteres de otra
"".join([f"{ord(x):03}" for x in "Mysuperstring"])
@wlizama
wlizama / never_commit_again.sh
Created July 23, 2019 14:06
No volver a considerar archivos o cambios que agregué a .gitignore
# Eliminamos cache de git
git rm -r --cached .
# Agregamos nuevamente archivos
git add .