Skip to content

Instantly share code, notes, and snippets.

View ruimaranhao's full-sized avatar

Rui Maranhao ruimaranhao

View GitHub Profile
@ruimaranhao
ruimaranhao / SoftEng.md
Last active March 27, 2022 19:50
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

@ruimaranhao
ruimaranhao / index.html
Last active March 25, 2016 12:45
Udacity P6
<html>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
</style>
@ruimaranhao
ruimaranhao / query.py
Last active March 29, 2016 22:27
Gremlin query
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)

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 / large.py
Last active January 16, 2018 11:22
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
@ruimaranhao
ruimaranhao / bulkdelete.sh
Created February 1, 2018 22:21
Bulk delete of GitHub repositories
#!/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 / google_foobar_decrypt.py
Created September 25, 2018 09:29
Google's Foobar: Decrypt last message, once all puzzles are solved.
#!/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 / python-guide-ist.md
Last active February 7, 2021 03:34
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
ruimaranhao / sign_commits.md
Last active January 17, 2019 22:55
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
ruimaranhao / AI4SE-CFP-BookChapters.md
Last active November 23, 2019 15:15
Call for Book Chapters: Artificial Intelligence Methods for Software Engineering

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