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 / 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
@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 / 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 / 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))))