Skip to content

Instantly share code, notes, and snippets.

View alaxalves's full-sized avatar
🏠
Hungry

Álax de Carvalho Alves alaxalves

🏠
Hungry
View GitHub Profile
@alaxalves
alaxalves / README.md
Created May 5, 2018 16:06
Rake task to check if your Rails database exist or not

Usage

  1. Create a file named "db.rake" under rails' "lib/tasks/db.rake"

  2. Place the code there and done!

It's great to use along with docker, since "A started container is not a ready container".

Sample usage can be found in: https://github.com/falko-org/Falko-API

@alaxalves
alaxalves / README.md
Created May 24, 2018 19:30
Como usar bem o git

Commits

O seu commit deve ser atomico, ou seja, ele deve fazer apenas uma coisa. Também é uma boa prática commitar em ingles. O seu commit deve descrever em poucas palavras o que ele está fazendo.

Para commitar use: git commit -m"This is my commit message"

Branches

As branches servem para manter um bom fluxo de trabalho. Elas são criadas a partir da branch que contem a ultima versão da sua aplicação, geralmente a branch 'master'.

@alaxalves
alaxalves / deploy.sh
Created December 28, 2018 18:52
Script to push to Heroku
#!/bin/bash
# Download and install Heroku CLI
# curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
# Insert here your Heroku app name
HEROKU_APP_NAME="MY-AWESOME-APP"
install_heroku() {
{
@alaxalves
alaxalves / FinalGSoC.md
Last active August 24, 2019 19:27
Final submission GSoC 2019

What is a MapKnitter

Mapknitter is a free and open-source software created and run by Public Lab. It lets people upload their own aerial images, position them in a web interface over some existing map data, share it, and export for print. It includes a bunch of sub-components - which contains a JavaScript UI- but the core application is written in Rails.

The challenge has been accepted!

My GSoC project was about upgrading Mapknitter project from Rails 3.2 to Rails 6.0. Initially, the project was running on Rails 3.2. So, to get a smoother upgrade, some steps should be taken before.

I knew that this would involve a lot of work and challenges to overcome, but I got the chance to work with

#!/bin/bash
BRIDGE_FILE=/etc/systemd/network/bridge.network
echo "========== Upgrading pkgs =========="
sudo apt update -y && sudo apt upgrade -y
echo "========== Removing file =========="
sudo apt-get remove -y docker \