Skip to content

Instantly share code, notes, and snippets.

View meyer1994's full-sized avatar
👀
¯\_(ツ)_/¯

João Meyer meyer1994

👀
¯\_(ツ)_/¯
View GitHub Profile
@meyer1994
meyer1994 / .travis.yml
Last active September 4, 2020 03:28
Simple Travis CI yaml
os: linux
dist: bionic
language: python
python:
- '3.7'
- '3.8'
cache:
pip: true
@meyer1994
meyer1994 / votes.py
Created February 6, 2018 00:58
Simple script to cast votes in a poorly created Google Form
import requests
FORM_LINK = 'YOUR FORM LINK'
OPTION = 'OPTION YOU WANT'
FORM_ID = 'YOUR ID (check in headers of form submission)'
data = {
f'entry{FORM_ID}': OPTION,
'fvv': 1,
'pageHistory': 0,
@meyer1994
meyer1994 / omp.c
Last active April 21, 2018 00:37
Test with openmp scopes
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#define TOTAL 1000
#define THREADS 10
long value = 0;
int test() {
@meyer1994
meyer1994 / in2out.py
Created September 8, 2018 19:54
Iterate over an sqaure matrix, from the inside out
'''
Created this for a school project. It works for both, matrices with even or odd orders.
'''
def iterate(mat):
order = len(mat)
cycles = order // 2
# odd
@meyer1994
meyer1994 / Connman eduroam UFSC config
Last active October 23, 2019 12:29
Connman configuration to use eduroam in UFSC university
# Config for EDUROAM at UFSC
[service_eduroam]
Type=wifi
Name=eduroam
EAP=peap
CACertFile=/etc/ssl/certs/ca-certificates.crt
Phase2=MSCHAPV2
Identity=**** # UFSC email
Passphrase=**** # UFSC password
@meyer1994
meyer1994 / abs.txt
Last active September 21, 2020 13:35
Downloads a cropped portion of each band from a sentinel 2 tile, generates NDVI and RGB images from the cropped downloads.
-1.0 200 0 0
-0.3 255 40 0
-0.1 255 150 0
0.1 255 240 0
0.3 0 230 0
0.5 0 190 0
1.0 0 130 0
nv 0 0 0 0
@meyer1994
meyer1994 / api.py
Last active January 23, 2020 14:18
Flask in AWS Lambda
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/ping', methods=['GET'])
def ping():
return "pong"
@meyer1994
meyer1994 / codes.csv
Last active March 22, 2020 17:49
Scrap EMEC universisties database
ID DA IES SIGLA DA IES MATRICULADOS
673 UNIGRAN 24206
322 UNIP 431410
3333 FTEC 3801
671 ANHANGUERA 157576
1 UFMT 20881
1028 UEMS 7454
1041 UNIVATES 8150
1042 UP - POSITIVO 26549
1043 UNIARARAS 12925
@meyer1994
meyer1994 / api.py
Last active September 4, 2020 03:24
Simple JSONRPC router with a flask-like interface
class Router(object):
def __init__(self):
super(Router, self).__init__()
self.handlers = {}
def method(self, name: str):
def wrapper(func: callable):
self.add_handler(name, func)
def wrapped(*args, **kwargs):
return func(*args, **kwargs)
@meyer1994
meyer1994 / grid.json
Last active August 6, 2020 19:04
Sentinel 2 tile grid bounding boxes
{
"01CCV": [
-180,
-73.0646329437,
180,
178.4323118931
],
"01CDH": [
-180,
-83.835333895,