Skip to content

Instantly share code, notes, and snippets.

🍍
Helping robots to steal all jobs

Gabriel Lima the-glima

🍍
Helping robots to steal all jobs
View GitHub Profile
View cookie.js
@the-glima
the-glima / metatags.html
Last active Apr 4, 2020 — forked from jaigouk/meta-tags.md
HTML Meta tags collection
View metatags.html
<!-- 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="">
@the-glima
the-glima / string.customIndexOf.js
Last active Apr 4, 2020
Custom String.prototype.indexOf
View string.customIndexOf.js
// String: Custom Index Of
String.prototype.customIndexOf = function(searchValue, fromIndex) {
var notfound = -1;
// Validating param: fromIndex
// fromIndex needs to be type number and needs to be an integer
if (typeof fromIndex !== 'number' || isNaN(fromIndex)) {
fromIndex = parseInt(fromIndex);
}
@the-glima
the-glima / prepare-commit-msg.sh
Last active Apr 4, 2020 — forked from bartoszmajsak/prepare-commit-msg.sh
Prepend branch name into commit message
View prepare-commit-msg.sh
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@the-glima
the-glima / git-show-commits-range.sh
Last active Apr 4, 2020
Show commits by a range of time
View git-show-commits-range.sh
# Show commits in a period of a time
gitCommits() {
period1=${1:-1}
period2=${2:-day}
if [ -z "$1" ]; then
echo "You can also specify the period, like: gcommit 1 week, or 2 day..."
fi
git log --oneline --after={$period1.$period2.ago} --no-merges --author="Gabriel"
@the-glima
the-glima / pr-check.js
Last active Apr 4, 2020
Automated checks when creating PRs
View pr-check.js
// ==UserScript==
// @name Github PR
// @namespace https://github.com/gabrihellmateus/
// @version 0.1
// @description Automate tasks for helping creating PRs
// @author Gabriel Lima (inspired by Doug Bacelar)
// @match https://github.com/gabrihellmateus/mercearia/pull/*
// ==/UserScript==
(function() {
@the-glima
the-glima / .hyper.js
Last active May 27, 2020
Terminal: My Hyper Configuration #website
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// hyper-opacity
opacity: 0.95,
// choose either `'stable'` for receiving highly polished,
@the-glima
the-glima / .bash_aliases
Last active May 27, 2020
My bash aliases #website
View .bash_aliases
# ----------------------
# Aliases
# ----------------------
# Terminal
alias .='cd .'
alias ..='cd ..'
alias ...='cd .. && cd ..'
alias ll='ls -alF'
alias la='ls -A'
@the-glima
the-glima / git-clean-branches-alias.sh
Last active May 28, 2020
[Git] Clean Branches Alias #website
View git-clean-branches-alias.sh
# If you want to delete all the local branches except the master branch
alias gbCleanAll="git branch | grep -v '^*' | xargs git branch -D"
# If you want to be a little less adventurous and delete only branches that have been merged to master
alias gbClean="git branch | grep -v '^*' | xargs git branch -d"
@the-glima
the-glima / sync-branch.sh
Last active May 28, 2020
[Git] Sync your current branch with another #website
View sync-branch.sh
# Add this to your .bash-aliases
function syncBranch() {
# Get your current branch
local CURRENT_BRANCH=$(git symbolic-ref --short HEAD)
local CURRENT_BRANCH="${CURRENT_BRANCH}"
# If you don't pass any argument it will use the default branch
local BASE_BRANCH="${1:-master}"
You can’t perform that action at this time.