This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -f "$1" ]; then | |
sed s/$/\\\\n/ "$1" | tr -d '\n' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/make | |
# exclude switches are useful for git and vim users. Other may apply here. | |
test: shellcheck.check | |
grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \ | |
--exclude-dir=.git --exclude=*.sw? \ | |
| xargs shellcheck | |
# .check targets just tests for a command to be available on your PATH. | |
.PHONY: %.check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Fetcher interface { | |
Fetch(url string) (body string, urls []string, err error) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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\]" |