Skip to content

Instantly share code, notes, and snippets.

View bretonics's full-sized avatar
:octocat:
Decoding the world, one line at a time

Andrés Bretón bretonics

:octocat:
Decoding the world, one line at a time
View GitHub Profile
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active April 20, 2024 02:26
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@geddski
geddski / styles.less
Last active April 3, 2017 10:09
improve Atom editor git gutter
atom-text-editor::shadow {
.line-numbers{
padding-left: 4px !important;
}
.git-line-modified, .git-line-added{
margin-left: -4px;
padding-left: 2px !important;
opacity: .5
}
@enriquesanchezb
enriquesanchezb / .bash_profile
Created November 8, 2014 09:55
bash_profile
export PS1="\[\e[00;37m\]\n\[\e[0m\]\[\e[01;36m\][\A]\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[01;32m\]\u\[\e[0m\]\[\e[01;36m\]@\[\e[0m\]\[\e[01;33m\]\h:\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[01;35m\]\w\[\e[0m\]\[\e[00;37m\]\n\[\e[0m\]\[\e[01;35m\]->\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Composer Alias
alias composer='php /usr/bin/composer.phar'
# Laravel 4 Artisan
alias art='php artisan'
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ericavonb
ericavonb / git-commit-style-guide.md
Last active April 9, 2024 15:37
Git Commit Style Guide

Git Commit Style Guide

Inspiration: Deis Commit Style Guide

I often quote Deis in sections below.

Motivation

It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.

@stephenturner
stephenturner / deseq2-analysis-template.R
Created July 30, 2014 12:20
Template for analysis with DESeq2
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
@azyu
azyu / .bash_profile
Created February 5, 2014 13:43
~/.bash_profile
case "${OSTYPE}" in
darwin*)
alias ls="ls -G"
alias ll="ls -lG"
alias la="ls -laG"
;;
linux*)
alias ls='ls --color'
alias ll='ls -l --color'
alias la='ls -la --color'
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@thomd
thomd / LC_COLORS.md
Last active April 20, 2024 13:26
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@TylerFisher
TylerFisher / hosting-on-github.md
Last active April 22, 2024 09:45
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level