Skip to content

Instantly share code, notes, and snippets.

Avatar

Rui Maranhao ruimaranhao

View GitHub Profile
@ruimaranhao
ruimaranhao / AI4SE-CFP-BookChapters.md
Last active Nov 23, 2019
Call for Book Chapters: Artificial Intelligence Methods for Software Engineering
View AI4SE-CFP-BookChapters.md

Call for Book Chapters:
Artificial Intelligence Methods for Software Engineering

Publisher: World Scientific, Singapore.

Editors

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
ruimaranhao / sign_commits.md
Last active Jan 17, 2019
Using gpg to sign git commits (MacOS)
View sign_commits.md

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
ruimaranhao / python-guide-ist.md
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).
View python-guide-ist.md

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
ruimaranhao / google_foobar_decrypt.py
Created Sep 25, 2018
Google's Foobar: Decrypt last message, once all puzzles are solved.
View google_foobar_decrypt.py
#!/usr/bin/python
import base64
MESSAGE = '''
CVIaWw4CFxIdT0FVUlIOXAgABkZCSEYMHRkFSwwGBwRJSFtPVRAaWggEHwQKT01PVRAPSAITBhJJ SFtPVRwHTR8EFggMBARIXlVOTw4JGwQYDQwKHAFODldBVRQABA4MGRANCUFBVRMPCgMGBgZODldB VRIPDgRIXlVOSAIOVUFUSEYYGxtICRA=
'''
KEY = 'rui.maranhao'
print(''.join(map(lambda x: chr(x[1] ^ ord(KEY[x[0] % len(KEY)])), enumerate(base64.b64decode(MESSAGE)))))
@ruimaranhao
ruimaranhao / bulkdelete.sh
Created Feb 1, 2018
Bulk delete of GitHub repositories
View bulkdelete.sh
#!/bin/sh
set -x
# For it to work, you need to install
# -- jq, https://stedolan.github.io/jq/
# -- http, https://httpie.org/
if [ "$#" -ne 1 ]; then
echo "Usage: $0 AUTORIZATION_TOKEN" >&2
@ruimaranhao
ruimaranhao / large.py
Last active Jan 16, 2018
Read a large dataset
View large.py
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
View keybase.md

Keybase proof

I hereby claim:

  • I am ruimaranhao on github.
  • I am ruimaranhao (https://keybase.io/ruimaranhao) on keybase.
  • I have a public key ASA5IGnak26zARIq1V0Dc1fsdaUQh7v5lCoE_F_DMiyECgo

To claim this, I am signing this object:

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

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