Skip to content

Instantly share code, notes, and snippets.

View rpapallas's full-sized avatar

Rafael Papallas rpapallas

View GitHub Profile
@rpapallas
rpapallas / opencv3_ros_indigo.sh
Last active September 20, 2018 13:19
Use with care. An up-to-date shell script for installing OpenCV 3 with ROS Indigo based on https://github.com/taochenshh/OpenCV-3.1-with-Python-2.7-and-ROS-Indigo. Note that this script is not fully tested but once we test this on a new machine we will update it.
# Copyright (C) 2018 The University of Leeds, School of Computing
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@rpapallas
rpapallas / apply_rotations_to_quat.py
Last active November 19, 2018 12:38
Apply rotations to quaternions quick utility tool using Python
# Requires pyquaternion -- pip install --user pyquaternion
from pyquaternion import Quaternion
import math
def apply_rotation(q1, axis, angle):
q2 = Quaternion(axis=axis, angle=angle)
result = q1 * q2
return result.elements
q1 = Quaternion(1, 0, 0, 0)
@rpapallas
rpapallas / .bashrc
Created April 16, 2019 11:20
Get local weather forecast from within your terminal
weather() {
curl wttr.in
}
@rpapallas
rpapallas / pdf_compressor.scpt
Created June 30, 2019 17:37
A simple AppleScript to automatically (lossless) compress a PDF using PDFExpert Compress Feature.
# Copyright (C) 2019 Rafael Papallas
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@rpapallas
rpapallas / demo.cpp
Created July 5, 2019 17:51
C++ thread of a class overloaded method
class MyClass {
.
.
bool desiredOverloadedMethod() {
return true;
}
bool desiredOverloadedMethod(int a) {
if(a == 1)
return false;
@rpapallas
rpapallas / two_column.tex
Created February 5, 2020 14:35
LaTeX two-column figure bottom of the first-page.
% The trick is with the following package. You **need** to use the following package.
\usepackage{nidanfloat}
% ....
% Put your figure near the first page content.
\begin{figure*}[b]
\centering
\def\svgwidth{\textwidth}
\import{sections/images/}{some_figure.pdf_tex}
@rpapallas
rpapallas / rosrun.sh
Created May 12, 2020 15:28
rosrun with GDB or Valgrind
rosrun --prefix 'gdb -ex run --args' catkin_package_name [arguments...]
rosrun --prefix 'valgrind --leak-check=full' catkin_package_name [arguments...]
@rpapallas
rpapallas / openrave_or_urdf.md
Created June 22, 2020 09:33
Installing or_urdf plugin for OpenRAVE 0.9

Installation

  • First, run the following to install libtinyxml2-dev on your system.
sudo apt-get install libtinyxml2-dev
  • I assume you have already configured your catkin_ws workspace, if not Google how to configure your catkin workspace.
  • Go to catkin_ws/src and clone the or_urdf repository from here. Note that this is a forked version because I changed something to the build destination of the plugin. I have created a pull request but as of now has not yet been approved. Have a look here and if the
@rpapallas
rpapallas / instructions.md
Last active April 20, 2025 02:06
Open file into NeoVim on macOS from Finder

Create a script that will allow macOS to open a source code file in iTerm2/Terminal and Vim/NeoVim

  • Open Automator and create a new application. You can name it "TerminalVim"
  • Works with any command basically, just change the following line set q to "nvim " & quote & myPath & quote to match what you want in the code below. For example: set q to "vim " & quote & myPath & quote to use Vim instead of NeoVim.
  • Paste the following code:
on appIsRunning(appName)
    tell application "System Events" to (name of processes) contains appName
end appIsRunning
@rpapallas
rpapallas / multiprocessing.py
Last active August 8, 2022 08:59
Multiprocessing in Python example
import time
import multiprocessing
num_of_particles = 50
def main_non_parellised():
results = []