Skip to content

Instantly share code, notes, and snippets.

View Yuri-M-Dias's full-sized avatar
🛰️
Off to space

Yuri Dias Yuri-M-Dias

🛰️
Off to space
  • Brazil
View GitHub Profile
@Yuri-M-Dias
Yuri-M-Dias / domain-grammar.txt
Created August 23, 2022 14:45 — forked from primaryobjects/domain-grammar.txt
Attempt at a basic STRIPS PDDL grammar parser for pegjs.org. To use, visit http://pegjs.org/online and paste the below grammar into the left-side window. In the right-side window, paste a PDDL domain file, such as https://spark-public.s3.amazonaws.com/aiplan/resources/random-domain.txt. The output will display in the Output panel.
/*STRIPS PDDL parser for http://pegjs.org/online
For example of parsing this grammar, see https://gist.github.com/primaryobjects/1d2f7ee668b62ca99095
Example PDDL domain to parse:
(define (domain random-domain)
(:requirements :strips)
(:action op1
:parameters (?x1 ?x2 ?x3)
:precondition (and (S ?x1 ?x2) (R ?x3 ?x1))
:effect (and (S ?x2 ?x1) (S ?x1 ?x3) (not (R ?x3 ?x1))))
@Yuri-M-Dias
Yuri-M-Dias / extractParticipants.py
Created July 30, 2019 21:48
Split PDF and rename pages to a defined CSV file
#!/usr/bin/env python
import os
import copy, sys
import pandas as pd
from PyPDF2 import PdfFileWriter, PdfFileReader
import slate3k as slate
def pdf_splitter(path, csvTargets):
fname = os.path.splitext(os.path.basename(path))[0]
@Yuri-M-Dias
Yuri-M-Dias / downloadArticlesAndAuthFile.gs
Created July 29, 2019 21:50
Copy Drive url files from a Google Sheets to another folder
function getIdFromUrl(url) { return url.match(/[-\w]{25,}/); }
function sendFilesToFolder() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 60; // Number of rows to process
// row x column, row x column
var startCol = 1
var endCol = 29
var dataRange = sheet.getRange(startRow, 10, numRows, 40);
@Yuri-M-Dias
Yuri-M-Dias / scrapSpaceOPS.R
Created April 16, 2019 20:02
Download all articles for a SPACEOPS conference. Handle with care, the website implements rate limits on the order of max 5 sessions/minute! (25/5 minutes)
library(rvest)
library(purrr)
library(here)
library(tictoc)
library(magrittr)
library(doParallel)
library(tidyverse)
# Downloads all articles from an AIAA page
import matplotlib.pyplot as plt
from scipy.io import wavfile
from glob import glob
import cv2
import pandas as pd
import numpy as np
from os.path import basename
import gc
import h5py
import os
@Yuri-M-Dias
Yuri-M-Dias / exe10.js
Last active October 8, 2017 15:48
Lista 6 - Exe 10
let operandos = "+-/*^";
let getPrioridade = (caracter) => {
if(caracter === "^") {
return 5;
}
if(caracter === "*" || caracter === "/") {
return 4;
}
if(caracter === "+" || caracter === "-") {
@Yuri-M-Dias
Yuri-M-Dias / keybase.md
Created June 29, 2017 18:40
keybase.md

Keybase proof

I hereby claim:

  • I am Yuri-M-Dias on github.
  • I am yurimdias (https://keybase.io/yurimdias) on keybase.
  • I have a public key whose fingerprint is 2F50 5F0A 0C4C CD99 A731 6C5F DE19 7A9D 3A09 177A

To claim this, I am signing this object:

@Yuri-M-Dias
Yuri-M-Dias / first.erl
Created June 22, 2017 02:48
FutureLearn - Erlang - 1.9
-module(first).
-export(
[
double/1,
mult/2,
area/3,
square/1,
treble/1
]
).
@Yuri-M-Dias
Yuri-M-Dias / DataMiningAlgorithms.py
Created March 9, 2017 12:57
An Nth nearest and Naive Bayes implementation in Python 3.
#!/usr/bin/env python
import math
import operator
from sklearn import datasets
from sklearn import svm
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
import matplotlib.pyplot as plt
@Yuri-M-Dias
Yuri-M-Dias / installVimWithClipboard
Created July 15, 2016 18:56
Partial vim build command to install it with clipboard functions, and python 2.7 on Linux Mint.
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
--enable-perlinterp \
--enable-luainterp \
--enable-cscope \
--enable-fontset \
--enable-xim \