This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(inputString) { | |
for(let i = 0; i < inputString.length / 2; i++) { | |
if (inputString[i] != inputString[inputString.length - i - 1 ]) | |
return false; | |
} | |
return true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log -m -1 --name-only --pretty="format:" commit_id_here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps | |
# f43a902fdef agitated_bassi | |
docker exec -it f43a902fdef bash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# detener todos los contenedores | |
for a in `docker ps -a -q` | |
do | |
echo "Stopping container - $a" | |
docker stop $a | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useEffect } from 'react'; | |
const useComponentWillMount = func => { | |
const willMount = useRef(true); | |
useEffect(() => { | |
willMount.current = false; | |
}, []); | |
if (willMount.current) { func(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-add-repository -y ppa:teejee2008/ppa | |
sudo apt update | |
sudo apt install timeshift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mount.cifs //172.19.39.33/d$ /mnt/servers/33-D -o user=admin,pass='my_super_password' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"".join([f"{ord(x):03}" for x in "Mysuperstring"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Eliminamos cache de git | |
git rm -r --cached . | |
# Agregamos nuevamente archivos | |
git add . |
NewerOlder