Skip to content

Instantly share code, notes, and snippets.

View ToniRV's full-sized avatar
🎯
Focusing

Antoni Rosinol ToniRV

🎯
Focusing
View GitHub Profile
@ToniRV
ToniRV / decompress_rosbags.py
Created January 6, 2021 05:06
Decompress uHumans2 dataset's rosbags
#!/usr/bin/env python3
import os
import errno
ids = {"apartment_scene":
["uHumans2_apartment_s1_00h.bag",
"uHumans2_apartment_s1_01h.bag",
"uHumans2_apartment_s1_02h.bag"
],
@ToniRV
ToniRV / download_uHumans2.py
Last active January 14, 2021 17:29
Download uHumans2 Dataset
#!/usr/bin/env python3
import os
import errno
import gdown
ids = {"apartment_scene":
{
"uHumans2_apartment_s1_00h.bag": '1kU_drpyG7glQ8pJyeztpiy214WbBEtbM',
"uHumans2_apartment_s1_01h.bag": '1jp7HrRsfGbmC-z757wwXDEpgNPHw0SbK',
#!/usr/bin/env python3
import xml.etree.ElementTree as ET
from lxml import html
import requests
DIRECTORY='/home/tonirv/Downloads/SpringerBooks/'
tree = ET.parse('Springer_Ebooks.xml')
root = tree.getroot()
@ToniRV
ToniRV / argparse.py
Created September 27, 2019 16:03
Minimal argparse example for copy-pasting
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo")
args = parser.parse_args()
print args.echo
@ToniRV
ToniRV / csv_reader.cpp
Created September 10, 2019 02:23
Cpp code to parse CSV files
/* Usage:
* std::ifstream file("plop.csv");
* for(CSVIterator loop(file); loop != CSVIterator(); ++loop)
* {
* std::cout << "4th Element(" << (*loop)[3] << ")\n";
* }
*/
class CSVIterator {
private:
class CSVRow {
@ToniRV
ToniRV / mp4-to-gif.bash
Last active January 18, 2022 04:57
Convert MP4 to high-quality GIF
#!/usr/bin/env python
import sys
import os
import shutil
import subprocess
import argparse
# Group of Different functions for different styles
if sys.platform.lower() == "win32":
@ToniRV
ToniRV / cbuild.py
Last active May 7, 2022 13:02
Makes the annoying 'mkdir build, cd build, cmake .., make -j $(nproc)' in one call in the root directory as 'cbuild'. It also accepts the arg `--clean` which calls `make clean` before `make`. Simplest way to have it as a command line function is to add it to your .bashrc as an alias like: `alias cbuild="${HOME}/path/to/cbuild.py"`
#!/usr/bin/env python
import signal
import sys
import os
import subprocess
import argparse
# Group of Different functions for different styles
if sys.platform.lower() == "win32":
// Based on [1] Book by Anthony A. Williams C++ Concurrency in Action.
/*******************************************************************************
* MIT License
*
* Copyright (c) 2018 Toni Rosinol
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell