Skip to content

Instantly share code, notes, and snippets.

View brunosimsenhor's full-sized avatar

Bruno Correia brunosimsenhor

  • Aveiro, Portugal
  • 23:01 (UTC)
View GitHub Profile
@brunosimsenhor
brunosimsenhor / load_dotenv.sh
Created January 22, 2024 13:44 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
// Place your key bindings in this file to override the defaults
[
{
"key": "shift+alt+down",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
# \[\033[01;33m\]$(__git_ps1)
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;33m\]$(__git_ps1)\[\033[00m\] \$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1) \$ '
fi
@brunosimsenhor
brunosimsenhor / entrypoint.sh
Last active October 4, 2018 01:09
Registering entrypoint
#!/usr/bin/env bash
set -x
pid=0
# SIGUSR1-handler (Register handler)
register () {
echo "Registering container $(hostname) with ip $(hostname -i)";
redis-cli -h cache -n 0 hset discovery $(hostname) $(hostname -i);
# nano ~/.bash_profile; source ~/.bash_profile;
gbranch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
export PS1="\[\e]0;\u@\h:\w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[33m\] ($(gbranch))\[\033[00m\] \$ "
#!/bin/bash
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}'
echo '# Configuring MailCatcher with RVM...'
echo '# Creating a directory apart from the main project... (MailCatcher conflicts with Ruby 5.x)'
mkdir -p ~/Dev/MailCatcher
cd ~/Dev/MailCatcher
echo '# Ensuring the 2.5.0 version in ruby with a different Gemset...'
echo '2.5.0' > .ruby-version
echo 'mailcatcher' > .ruby-gemset
echo "# Installing MailCatcher's gem..."