Skip to content

Instantly share code, notes, and snippets.

Rik gitaarik

Block or report user

Report or block gitaarik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gitaarik
gitaarik / npmbin.sh
Created Mar 1, 2016
Alias to add the `node_modules/.bin/` directory to `$PATH` variable so that you can use executables from node modules.
View npmbin.sh
alias npmbin='echo -e "Setting up npmbin with path:\n$(npm bin)"; export PATH=$(npm bin):$PATH'
@gitaarik
gitaarik / gitprompt.sh
Last active Oct 1, 2016
native gitprompt
View gitprompt.sh
gitprompt() {
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWSTASHSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWUPSTREAM="auto"
export GIT_PS1_SHOWCOLORHINTS=true
export PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
. /usr/lib/git-core/git-sh-prompt
@gitaarik
gitaarik / git_submodules.md
Last active Sep 17, 2019
Git Submodules basic explanation
View git_submodules.md

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
View git_cheat_sheet.md

Git cheatsheet

Checkout remote branch:
git checkout -t remote_name/remote_branch_name
Delete a branch at the origin:
git push origin --delete <branchName>
@gitaarik
gitaarik / git_bash_prompt.sh
Last active May 17, 2019
Alters bash to make working with Git in the shell easier. Will set the current repository and branch name in the prompt and makes `g` an alias to `git`.
View git_bash_prompt.sh
#!/bin/bash
_git_has_commits() {
if git rev-parse --verify HEAD > /dev/null 2>&1; then
return 0
else
return 1
fi
@gitaarik
gitaarik / git-pre-commit-check-misspelling
Last active Jul 31, 2019
Pre-commit git-hook that looks for misspelled words and if found notifies the committer about them and aborts the commit. I made it because some developers in my team misspelled classnames/methodnames/variables, and the misspellings kept coming back after they were fixed. This will prevent some misspellings from entering the repository. You can …
View git-pre-commit-check-misspelling
#!/bin/bash
declare -a words=(resourse initialise construkt)
declare -a misspellings
i=0
for word in ${words[@]}
do
@gitaarik
gitaarik / south_unran_migration_check.py
Last active Dec 19, 2015
Django Middleware that checks if you ran all South migrations. If not, it will throw an exception. Make sure to only use this middleware in development!
View south_unran_migration_check.py
from south import migration
from south.models import MigrationHistory
class SouthUnranMigrationCheck(object):
def process_request(self, request):
'''
Checks if you ran all South migrations. If not, it will throw an
exception (DidNotApplyAllMigrations).
@gitaarik
gitaarik / temporary-email-address-domains
Last active Jun 9, 2019 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
View temporary-email-address-domains
0-mail.com
0815.ru
0845.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
10minutemail.net
12houremail.com
12minutemail.com
You can’t perform that action at this time.