Skip to content

Instantly share code, notes, and snippets.


Matteo Ragni MatteoRagni

Block or report user

Report or block MatteoRagni

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MatteoRagni /
Created Dec 5, 2019
Pybind11 inheritance from a virtual class with different signature methods
#include "pybind11/pybind11.h"
#include <tuple>
namespace py = pybind11;
// Begin Library
class Animal {
virtual ~Animal() { }
virtual int go(int a, int & b) = 0;
MatteoRagni / .clang_format
Last active Oct 9, 2019
C++ Clang Format
View .clang_format
BasedOnStyle: Google
AccessModifierOffset: '0'
AlignConsecutiveAssignments: 'true'
AlignEscapedNewlines: Right
AlignTrailingComments: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: 'false'
MatteoRagni / udp.hh
Last active Sep 10, 2019
View udp.hh
#ifndef UDP_HH_
#define UDP_HH_
#include <array>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <iostream>
class UDPSender {
std::string ip;
MatteoRagni / rtos_queue.hpp
Created Feb 14, 2019
FreeRTOS Queue Manager. Does work only with -frtti (f**k)
View rtos_queue.hpp
* rtos_wrap.hpp
* Created on: 13 feb 2019
* Author: MatteoRagni
MatteoRagni / drive.scan.rb
Created Nov 20, 2018
Downloader for google drive (utility for me...)
View drive.scan.rb
#!/usr/bin/env ruby
require 'json'
# Position of the mounted drive
$SOURCE = "/Volumes/GoogleDrive/Il mio Drive"
# Destination of the json file
$DEST = "/tmp/result.json"
# Size for "too big" files
$XGB = 2
MatteoRagni / compile.m
Created Oct 30, 2018
Shared memory and Matlab using Boost
View compile.m
MEX_OPT = ['-I', '/usr/local/Cellar/boost/1.67.0_1/include'];
MEX_SRC = { ...
'menage_share.cpp', ...
'read_share.cpp', ...
'write_share.cpp' ...
for i = 1:length(MEX_SRC)
mex(MEX_OPT, MEX_SRC{i});
MatteoRagni / goto.rb
Created Jan 22, 2018
Converts windows path to WSL linux path
View goto.rb
#!/usr/bin/env ruby
require 'optparse'
def convert_to_path(f, is_file)
ret = f.gsub(/^([A-Z]):/) { |m| "/mnt/#{m[0].downcase}" }
ret = ret.gsub(/\\/, "/")
ret = ret + "/../" if is_file
return ret
MatteoRagni /
Last active Dec 7, 2017
Configuring Custom Default figure options in Matlab

Default Graphic Configuration


Check which is the startup file through the command:

which startup
MatteoRagni / Procfile
Last active Oct 22, 2017
Simple app deployed on Heroku for this Stackoverflow question:
View Procfile
web: node .
MatteoRagni / pos.rb
Created Sep 22, 2017
Position for the images for the autoencoder
View pos.rb
#!/usr/bin/env ruby
# Reconstruct position
f = 0
for a in 0...25
for b in 0...25
next if b == a
for c in 0...25
You can’t perform that action at this time.