Skip to content

Instantly share code, notes, and snippets.

View gabraganca's full-sized avatar
🚀
going above and beyond

Gustavo Bragança gabraganca

🚀
going above and beyond
View GitHub Profile
@gabraganca
gabraganca / README.md
Last active December 25, 2022 00:34
Kinesis Agent on Ubuntu 16.04

Setting Up Kinesis Agent on Ubuntu 16.04

To ease the process, I created a script that automatizes the installation of the Agent. The steps are:

  1. Create the configuration file for the agent following these readings:
@gabraganca
gabraganca / gremlin_ex.md
Created June 24, 2018 01:37
Exercício Gremlin

Gremlin - Exercício

  1. Quantos vértices existem?

    gremlin> g.V().count()
    ==>18
    
  2. Visite todo nó e respectivas proprieadades

@gabraganca
gabraganca / desafio_neo4j.md
Created June 23, 2018 02:17
Desafio Neo4j

Desafio Neo4j

Comece criando o banco de dados de cinema

:play movie-graph

Em seguida, Faça:

@gabraganca
gabraganca / salarios_dados.py
Created June 16, 2018 22:10
Salários mensais da área de dados
"""
Cria grafico de barras com os salarios para carreiras na area de dados.
Os valores forma obtidos no LoveMondays
author: Gustavo Braganca (ga.braganca@gmail.com)
"""
import matplotlib.pyplot as plt
from collections import OrderedDict
@gabraganca
gabraganca / bracket_balancing.py
Created May 18, 2018 12:01
Check if multiple brackets are balanced.
def is_balanced(s):
"""
Check if a string has balanced brackets.
Parameters
----------
s: str
String to be checked.
@gabraganca
gabraganca / frequent_number.py
Created May 17, 2018 02:20
Get the most frequent number from a list.
def MostPopularNumber(array, array_length=None):
"""
Get the most frequent number from an array.
If there arre two or more numbers that appear
the same number of times, return the lowest.
Parameters
----------
@gabraganca
gabraganca / palindrome.py
Created May 17, 2018 02:20
Check if the word is or almost is a palindrome. To be almost a palindrome, we would need to change only one character.
def IsAlmostPalindrome(word):
"""
Check if the word is or almost is a palindrome.
To be almost a palindrome, we would need to change
only one character.
Parameters
----------
@gabraganca
gabraganca / distance_average.py
Created May 17, 2018 02:19
Get the average distance of three points in the cartesian plane.
from math import sqrt
def get_distance(first_coord, second_coord):
"""
Get the distance between two points in the cartesian plane.
Parameters
----------
first_coord: tuple
@gabraganca
gabraganca / get_closing_bracket.py
Created May 16, 2018 03:04
Get position of closing bracket if the poisition of the opening bracket is given.
def get_closing_index(string, index):
"""
Get position of closing bracket of a opening
bracket given by `index`.
Parameters
----------
string: str;
Input text.
@gabraganca
gabraganca / bootstrap_cmdline.py
Created May 8, 2018 15:11 — forked from elmotec/bootstrap_cmdline.py
Minimal python program with logging and argparse.
#!/usr/bin/env python
# encoding: utf-8
"""Minimal python commad line."""
import sys
import argparse
import logging