Skip to content

Instantly share code, notes, and snippets.

View brunodb3's full-sized avatar
πŸ’»
Doing stuff

Bruno brunodb3

πŸ’»
Doing stuff
View GitHub Profile
@brunodb3
brunodb3 / description.md
Created April 13, 2022 13:06 — forked from juanje/description.md
Connect services with docker-compose at multirepo project

Connect services with docker-compose at multirepo project

Sometimes you have a project with different services (or microservices) and each one of them has its own repository. At those cases, tests the whole project (and its interactions) can be challenging.

With Docker and Docker Compose you can run easily each service from its repo, but for making them to see each other you (usually) need to manually create a network with Docker, assume so facts (as directories names) or do some crazy network configurations.

TL;DR

You have the final configuration here.

@brunodb3
brunodb3 / rell_example.rell
Last active November 2, 2021 11:48
Rell Example
// notes:
// - I like the "query" notation of `@` and `@*`. It's short and simple, and makes so much sense. `user at name equals 'bruno'` is nice
// - on an actual project, could be difficult to differentiate `val` and `var` in a glance. I wonder if the linting is smart enough to see that `val` cannot be reassigned (I assume yes)
// - I like that Rell doesn't need type declarations, but that it offers it. makes code better to follow and understand for devs
// - I don't like that the web UI doesn't have autocomplete or type-check. It's nice when errors are found while I'm typing
//
entity user {
key pubkey;
key username: text;
@brunodb3
brunodb3 / travis.github.md
Last active June 21, 2021 11:28
Set up GitHub deploy keys for Travis

Set up GitHub deploy keys for Travis

Based on qoomon's Gist.


See the Travis documentation for more information.

These commands should be run on the root of your project/repository.

@brunodb3
brunodb3 / example.travis.yml
Last active June 23, 2021 10:02
Example travis.yml
language: node_js
node_js:
- "12.14"
before_deploy: "npm run build"
jobs:
include:
- stage: Test
script:
@brunodb3
brunodb3 / dazn_challenge_question_12.js
Created February 19, 2019 00:02
DAZN Challenge Question 12
function widestGap(n, start, finish) {
// Write your code here
let gaps = []
let positionsWithCars = []
let positionsWithoutCars = []
const getCarPositions = (start, end, step) => {
// returns all the positions a car occupies
// there's a bug when a car occupies positions such as [2,2], this is solved with a temporary solution:
// if (carPositions[1] == undefined) carPositions[1] = car.finish;
@brunodb3
brunodb3 / config.zshrc
Created August 31, 2018 00:56
My custom .zshrc config file
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/bruno/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"
@brunodb3
brunodb3 / send_email.py
Last active August 16, 2018 05:02
This file is used to send an email, passing the message and subject as arguments
# -*- coding: utf-8 -*-
# this file is used to send an email, passing the message and subject as arguments
#
# to run the file:
# pyhon send-email.py "this is the subject" "this is the message"
#
# * be sure to properly config your email and password at the login function
# * this file was configured mainly for Google emails, not tested on other providers
# * for Google emails, you have to enable access for less secure apps on your account
@brunodb3
brunodb3 / online_notepad
Created July 5, 2017 18:52
This is a HTML code that you can paste in the URL field of a modern browser, to open an online notepad
data:text/html;charset=utf-8,
<title>Online Notepad</title>
<style>
html{ height: 100%; }
body{ background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 1%; height: 94%; }
.center { margin: auto; width: 50%; padding: 10px; }
img.center { display: block; margin: 0 auto; }
.logo { width: 150px; }
.paper { font: normal 12px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-back
@brunodb3
brunodb3 / maintenance_template.html
Created May 2, 2017 13:17
Site Maintenance Template
<!doctype html>
<title>Site Maintenance</title>
<style>
body {
text-align: center;
padding: 150px;
}
h1 {
font-size: 50px;
@brunodb3
brunodb3 / install_dependencies_lite.sh
Last active June 14, 2017 16:06
This file installs the lite version of my developer dependencies (intended to run at AWS servers)
#!/bin/bash
# This file installs the lite version of my developer dependencies (intended to run at AWS servers)
#
# ***********************************
# Only for Ubuntu based Linux Distros
# ***********************************
#
# PPA packages and Python Software Properties
sudo apt-get install software-properties-common python-software-properties -y
# MongoDB repo information