Skip to content

Instantly share code, notes, and snippets.


Rui Maranhao ruimaranhao

View GitHub Profile
ruimaranhao /
Last active Nov 23, 2019
Call for Book Chapters: Artificial Intelligence Methods for Software Engineering

Call for Book Chapters:
Artificial Intelligence Methods for Software Engineering

Publisher: World Scientific, Singapore.


Scope and Purpose

Software is an integral part of our lives today. It is in the heart of a wide range of systems, from large management systems for health care or electricity power stations to small and local systems as smart home or even coffee machines. Modern software systems are highly complex and often have multiple dependencies on external parts such as other processes or services. This poses new challenges and exacerbate existing challenges in different aspects of Software Engineering (SE) including design, testing, debugging, and software lifec

ruimaranhao /
Last active Jan 17, 2019
Using gpg to sign git commits (MacOS)

Run the following to install the gpg agent:

brew upgrade gnupg  # This has a make step which takes a while
brew link --overwrite gnupg
brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent

echo "test" | gpg --clearsign
ruimaranhao /
Last active Feb 7, 2021
A guide of best practices to developing in Python (meant for the first year students of the Instituto Superior Técnico, U.Lisboa).

A Guide of Best Practices for Python

A guide of best practices to developing in Python (meant for the first year students of the Instituto Superior Técnico, University of Lisbon). Do you want to have a hard-cover book on this, check this list out.

Inspired in Steve Sloria's gist.

In General

"Beautiful is better than ugly." - [PEP 20][]

ruimaranhao /
Created Sep 25, 2018
Google's Foobar: Decrypt last message, once all puzzles are solved.
import base64
KEY = 'rui.maranhao'
print(''.join(map(lambda x: chr(x[1] ^ ord(KEY[x[0] % len(KEY)])), enumerate(base64.b64decode(MESSAGE)))))
ruimaranhao /
Created Feb 1, 2018
Bulk delete of GitHub repositories
set -x
# For it to work, you need to install
# -- jq,
# -- http,
if [ "$#" -ne 1 ]; then
echo "Usage: $0 AUTORIZATION_TOKEN" >&2
ruimaranhao /
Last active Jan 16, 2018
Read a large dataset
import multiprocessing
import time
import os
import mmap
from math import ceil
def size_and_chunks(file_name, processes):
sz = os.path.getsize(file_name)
return sz, sz / processes + 1

Keybase proof

I hereby claim:

  • I am ruimaranhao on github.
  • I am ruimaranhao ( on keybase.
  • I have a public key ASA5IGnak26zARIq1V0Dc1fsdaUQh7v5lCoE_F_DMiyECgo

To claim this, I am signing this object:

ruimaranhao /
Last active Mar 29, 2016
Gremlin query
import asyncio
from aiogremlin import GremlinClient
loop = asyncio.get_event_loop()
gc = GremlinClient(loop=loop)
execute = gc.execute(QUERY)
result = loop.run_until_complete(execute)
View index.html
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
ruimaranhao /
Last active Sep 25, 2020
Using Github to Teach Software Engineering: A Hands-on Approach

Teaching Software Engineering using GitHub

Rui Maranhão

Software engineering is the study and an application of engineering to the software development lifecycle, including requirements, design, architecture, development, testing, and maintenance. It is important that Universities teach students not only the theory underlying these phases, but also allow students to practice using real systems.

Quoting Arie van Deursen:

When teaching software engineering [architecture] it is hard to strike the right balance between practice (learning how to work with real systems and painful trade offs) and theory (general solutions that any architect needs to thoroughly understand).

To address this, inspired by TUDelft's Software Architecture course, we decided try something different in the Software Engineering course of the University of Porto's [Master in