Skip to content

Instantly share code, notes, and snippets.

View ricardogarfe's full-sized avatar
enjoy

Ricardo García Fernández ricardogarfe

enjoy
View GitHub Profile
@ricardogarfe
ricardogarfe / nvmCommands.js
Created April 1, 2024 08:24 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@ricardogarfe
ricardogarfe / Makefile Python environment
Last active September 13, 2022 08:17
Makefile for python environments
ENVPATH ?= .venv
all: help
help: ## Show available targets message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
## Configure virtual environment and install dependencies
venv-configure: ## Configure virtual environment and install dependencies
@echo ">>> Configure virtual environment..."
@ricardogarfe
ricardogarfe / Python3 Virtualenv Setup.md
Last active September 7, 2022 13:31 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@ricardogarfe
ricardogarfe / docker_remove_images_without_tag.md
Created April 1, 2020 19:32
Remove all docker images without tag

Remove images

$ docker rmi -f $(docker images -f "dangling=true" -q)
@ricardogarfe
ricardogarfe / virtualenv-python-version.md
Created June 25, 2019 10:29
Steps to create Python virtual environment with selected version

Python VirtualEnv

Create Python virtual environment with selected Python version:

$ virtualenv --python=/usr/bin/python2.7 ~/virtualenvs/hello_world

Enable virtual environment:

@ricardogarfe
ricardogarfe / sonar-project.properties
Created March 8, 2019 06:16
sonar-project.properties basic example
# must be unique in a given SonarQube instance
sonar.projectKey=my:project
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=My project
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
# If not set, SonarQube starts looking for source code from the directory containing
# the sonar-project.properties file.
node {
// Mark the code checkout 'stage'....
stage 'Checkout'
checkout scm
stage 'Configure'
env.PATH = "${tool 'Maven 3'}/bin:${env.PATH}"
// Mark the code build 'stage'....
stage('Build') {
@ricardogarfe
ricardogarfe / .bashrc
Created February 10, 2017 07:56
Git bash branch location
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@ricardogarfe
ricardogarfe / gitconfig
Last active July 6, 2026 10:31
update git lg after ten years
[color]
ui = auto
branch = auto
diff = auto
status = auto
[core]
pager = less -FRX
[alias]
@ricardogarfe
ricardogarfe / git-move-commits-to-a-branch.md
Last active October 14, 2019 11:37
Move git commmits to a new branch

Move commmits between branches

From this:

master A - B - C - D - E

Move C - D - E to a new branch: