Skip to content

Instantly share code, notes, and snippets.


Aram Peres momothereal

Block or report user

Report or block momothereal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
package tictactoegame.ui;
import javax.swing.*;
import java.awt.*;
public class SwingTicTacToe extends JFrame {
* The font used for the buttons.
View ffmount.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <sys/mount.h>
extern char * ffmount(char *path)
int rc;
momothereal /
Created Jun 17, 2018
My solution to the "Road navigation" edabit challenge
# coding=utf-8
import json
import os
def neighbours_of(edges, node):
neighbours = []
for edge in edges:
if node in edge:
neighbours.append(edge[0 if edge[1] == node else 1])
momothereal /
Last active May 10, 2018
Selection, Insertion, Bubble and Merge sort in Python 3
def selection_sort(array):
for index in range(len(array)):
currentMin = array[index]
currentMinIndex = index
# check the minimum value in the sub-array after the current index
for subIndex in range(index + 1, len(array)):
if array[subIndex] < currentMin:
currentMin = array[subIndex]
currentMinIndex = subIndex
momothereal /
Last active Mar 13, 2018
A python TensorFlow script that uses supervised learning to sum scalars
import numpy as np
import tensorflow as tf
batch_size = 1
data_size = 10000
batches = int(data_size / batch_size)
# X is a (n 2) matrix with random positive floats between 0 and 100
X = np.random.rand(data_size, 2)
# Y is a (n 1) matrix with the sum of the two columns of X
momothereal /
Created Feb 8, 2018
curl request to find real-time STM bus times at a certain stop.
# This is a curl command to get live/real-time STM bus schedules for a stop.
# Note that the "Origin" request header set to "" is necessary.
curl -H "Accept: application/json" -H "Origin:" "{BUS_LINE}/stops/{STOP_ID}/arrivals?d={DATE_YYYY_MM_DD}&t={24H_TIME_HHMM}&direction={DIRECTION}&wheelchair=0&limit=5"
# {BUS_LINE} = Line number (e.g. 123)
# {STOP_ID} = Stop number (e.g. 12345)
# {DATE_YYYY_MM_DD} = The date, in the YYYYMMDD format (e.g. 20180208)
# {24H_TIME_HHMM} = The time, in 24-hour format (HHMM) (e.g. 1348)
# {DIRECTION} = Line direction, E/W/N/S
View httpserver.js
// the shortest JS code to create and run an HTTP server, using the least amount of different characters possible.
// this only works on node.js for obvious reasons.
// if you don't want any response body (just accept the connection):
# Adapted from
# Show git branch name
parse_git_branch() {
pls_branch="git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'"
branch_name=$(eval $pls_branch)
echo -ne $branch_name
if [ ! "$branch_name" = '' ]; then
import java.nio.file.Files;
import java.util.List;
* Written by Aram Peres
public class SudokuSolver {
public static void main(String[] args) throws IOException {

Keybase proof

I hereby claim:

  • I am momothereal on github.
  • I am momothereal ( on keybase.
  • I have a public key ASBFvh5Vc6VpYW2Rvr8jOhpGkTGfSPtlcua3G9bx-wo8ugo

To claim this, I am signing this object:

You can’t perform that action at this time.