Skip to content

Instantly share code, notes, and snippets.

View the-glima's full-sized avatar
🎧
Helping robots to steal all jobs

Gabriel Lima the-glima

🎧
Helping robots to steal all jobs
View GitHub Profile
# Bash best practices and style-guide
Just simple methods to keep the code clean.
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/).
## Quick big rules
* All code goes in a function
* Always double quote variables
@the-glima
the-glima / stimulus.md
Created March 9, 2021 13:13 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@the-glima
the-glima / get-latest-tag-on-git.sh
Last active May 28, 2020 08:50 — forked from rponte/get-latest-tag-on-git.sh
[Git] Getting the latest tag #website
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@the-glima
the-glima / multiple_ssh_setting.md
Last active May 24, 2021 03:27 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys GitHub setup

Multiple SSH Keys settings for different github account

create different public key

Make sure you have .ssh folder created:

@the-glima
the-glima / prepare-commit-msg.sh
Last active July 17, 2020 15:09 — forked from bartoszmajsak/prepare-commit-msg.sh
Prepend branch name into commit message
#!/bin/bash
FILE=$1
MESSAGE=$(cat $FILE)
TICKET=$(git rev-parse --abbrev-ref HEAD | grep -Eo '^(\w+\/)?(\w+[-_])?[0-9]+' | grep -Eo '(\w+[-])?[0-9]+' | tr "[:lower:]" "[:upper:]")
if [[ $TICKET == "" || "$MESSAGE" == "$TICKET"* ]];then
exit 0;
fi
echo "$TICKET: $MESSAGE" > $FILE
@the-glima
the-glima / metatags.html
Last active April 4, 2020 02:21 — forked from jaigouk/meta-tags.md
HTML Meta tags collection
<!-- Basic HTML Meta Tags -->
<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
<meta name="robots" content="index,follow" />
<meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm" />
<meta name="abstract" content="">
<meta name="topic" content="">