Skip to content

Instantly share code, notes, and snippets.

View edupo's full-sized avatar

Edu P. edupo

View GitHub Profile
@edupo
edupo / twoline_prompt.sh
Last active April 17, 2019 00:28 — forked from mkottman/twoline_prompt.sh
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with some version control
# system prompts (git, mercurial, svn adn fossil) aligned to the right.
# Author: Michal Kottman, 2012
# Contributor: DrumMeister, 2016
# Contributor: Eduardo Lezcano, 2016
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
@edupo
edupo / Jenkinsfile.groovy
Created September 29, 2017 12:14 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'No quotes in single backticks'
sh 'echo $BUILD_NUMBER'
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"'
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"'
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"'
echo 'Using three backslashes still results in preserving the single quotes'