Skip to content

Instantly share code, notes, and snippets.

View jmscarnatto's full-sized avatar
🎯
Focusing

Jose Scarnatto jmscarnatto

🎯
Focusing
View GitHub Profile
@jmscarnatto
jmscarnatto / gist:0844abb7ad75b059ee5d8710d65d73d5
Created August 16, 2022 12:36
Add oh-my-zsh with powerlevel10k to Dockerfile
ENV HOME=/home/dev
# INSTALL APT DEPENDENCIES
RUN apt-get update -qq && apt-get upgrade -y && apt-get install -y --no-install-recommends build-essential git wget zsh
# OH-MY-ZSH
RUN wget -P $HOME https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh; \
sh $HOME/install.sh; \
rm $HOME/install.sh

Data->Multiple Operatios

Data Table function in ms-excel

Commit - Clone a container or snapshot

docker commit my_origin_container my_container_snapshot:yymmdd
docker run --name=my_clone my_container_snapshot:yymmdd

Delete stopped containers

docker container prune
alias ll="ls -al"
alias linda='ls -lah | sort -r | awk '\''NF==9 { if ($1~/^d/) { printf $1 "/" $2 "/" $3 "/" $4 "/" $5 "/" $6 " " $7 "/" $8 " " "\033[1;34m" $9 "\033[0m" "\n" } else { printf $1 "/" $2 "/" $3 "/" $4 "/" $5 "/" $6 " " $7 "/" $8 " " "\033[1;32m" $9 "\033[0m" "\n" } }'\'' | column -t -s"/"'
alias dps="docker ps"
alias dcps="docker compose ps"
alias dim="docker images"
alias bus="cd ~/Documents/Projects/Clients/BusPatrol"
alias gck="git checkout"
alias gil="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gis="git status"
alias gita="git commit --amend --no-edit"
@jmscarnatto
jmscarnatto / Git_Snippets.md
Last active October 21, 2025 20:42
Git most frequently used commands

Really frequent mistake!! - Push when the remote has changed

git reset --soft HEAD~1  # this undoes the last commit and preserves last changes
git pull
git commit -m 'my erased last commit comments'
git push

Prompt for SHORT PR description creation (small fixes)

Generate a raw markdown pull request description for a hotfix|fix|feature.  
Compare the current branch with the reference branch {{reference_branch}}, analyze the diff, and answer the following questions clearly and concisely:
ActiveRecord::Base.connection.execute("TRUNCATE TABLE <table_name>")
@jmscarnatto
jmscarnatto / RSA Key generator
Created July 24, 2021 17:13
Online RSA Public and Private Key Generator
http://travistidwell.com/blog/2013/09/06/an-online-rsa-public-and-private-key-generator/
@jmscarnatto
jmscarnatto / Always Sudo Privileges
Created July 7, 2021 00:10
Always Sudo Privileges
> cd /etc
> sudo visudo
edit line
# User privilege specification
root ALL=(ALL:ALL) ALL
por
root,your-user-name ALL=(ALL:ALL) ALL
@jmscarnatto
jmscarnatto / Crud Vue Vuetify
Created July 5, 2021 23:42
Simple Crud Vue Vuetify
https://www.dropbox.com/s/qovgni72u6ylo68/crud_vuetify_2020.zip?dl=0
@jmscarnatto
jmscarnatto / Git clone single branch
Created June 10, 2020 18:15
Git clone single branch
git clone --single-branch --branch <branchname> <remote-repo>