This file contains hidden or 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
_yarn() { | |
local cur prev commands scripts opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
commands="access add autoclean bin cache check config create exec generate-lock-entry global\ | |
help import info init install licenses link list login logout node outdated owner pack publish\ | |
remove run tag team unlink upgrade upgrade-interactive version versions why workspace workspaces" |
This file contains hidden or 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
[Unit] | |
Description=Redis In-Memory Data Store | |
After=network.target | |
[Service] | |
User=redis | |
Group=redis | |
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf | |
ExecStop=/usr/local/bin/redis-cli shutdown | |
Restart=always |
This file contains hidden or 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
PROMPT_COMMAND=__prompt_command | |
__prompt_command() { | |
# Remove previous existing .bin in $PATH | |
PATH=$(echo $PATH | sed -e "s@[^:]\+node_modules/.bin@@ ; s/\(^:\|:$\)// ; s/::/:/") | |
# Add current .bin and export | |
export PATH=$(npm bin):$PATH | |
} |
This file contains hidden or 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
const amqp = require('amqplib'); | |
const getChannel = async (uri = 'amqp://localhost') => { | |
const connection = await amqp.connect(uri); | |
return connection.createChannel(); | |
}; | |
const postMessages = async (channel, queue) => { | |
await channel.assertQueue(queue); |
This file contains hidden or 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
# Install mongodb 3.4 as root | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 | |
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list | |
apt-get install -y mongodb-org=3.4.0 mongodb-org-server=3.4.0 mongodb-org-shell=3.4.0 mongodb-org-mongos=3.4.0 mongodb-org-tools=3.4.0 | |
systemctl enable mongod |
This file contains hidden or 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
[user] | |
name = Arnaud Courtecuisse | |
[alias] | |
cfg = !code ~/.gitconfig | |
ignore = "!ignore() { while [ -n \"$1\" ]; do echo $1 >> .gitignore; shift; done }; ignore" | |
br = branch | |
d = diff --ignore-all-space | |
ds = diff --staged | |
aa = add --all | |
ap = add --all --patch |
This file contains hidden or 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
fancy_branch_descr() { | |
local fancy=${1//[-_]/ } | |
echo ${fancy^} | |
} | |
create_commit_message() { | |
local base=$1 branch=$2 | |
fancy_branch_descr $branch | |
git log --pretty=format:"%n* %s" ${base}..${branch} | |
} |