Skip to content

Instantly share code, notes, and snippets.

View MatteoRagni's full-sized avatar
🎱

Matteo Ragni MatteoRagni

🎱
View GitHub Profile
@MatteoRagni
MatteoRagni / udp.hh
Last active September 10, 2019 14:44
UDP Sender via BOOST ASIO
#ifndef UDP_HH_
#define UDP_HH_
#include <array>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <iostream>
class UDPSender {
std::string ip;
@MatteoRagni
MatteoRagni / rtos_queue.hpp
Created February 14, 2019 11:11
FreeRTOS Queue Manager. Does work only with -frtti (f**k)
/*
* rtos_wrap.hpp
*
* Created on: 13 feb 2019
* Author: MatteoRagni
*/
#ifndef APPLICATION_USER_CORE_RTOS_WRAP_HPP_
#define APPLICATION_USER_CORE_RTOS_WRAP_HPP_
@MatteoRagni
MatteoRagni / drive.scan.rb
Created November 20, 2018 08:03
Downloader for google drive (utility for me...)
#!/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
MatteoRagni / compile.m
Created October 30, 2018 15:37
Shared memory and Matlab using Boost
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
MatteoRagni / goto.rb
Created January 22, 2018 07:40
Converts windows path to WSL linux path
#!/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
end
@MatteoRagni
MatteoRagni / 00_README.md
Last active December 7, 2017 11:19
Configuring Custom Default figure options in Matlab

Default Graphic Configuration

Installation

Check which is the startup file through the command:

which startup
@MatteoRagni
MatteoRagni / Procfile
Last active October 22, 2017 12:24
Simple app deployed on Heroku for this Stackoverflow question: https://stackoverflow.com/questions/46873665
web: node .
@MatteoRagni
MatteoRagni / pos.rb
Created September 22, 2017 19:09
Position for the images for the autoencoder
#!/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
@MatteoRagni
MatteoRagni / state2_hash.json
Last active August 31, 2017 19:38 — forked from mshafrir/states_hash.json
US states in JSON form
{
"Alabama": "AL",
"Alaska": "AK",
"American Samoa": "AS",
"Arizona": "AZ",
"Arkansas": "AR",
"California": "CA",
"Colorado": "CO",
"Connecticut": "CT",
"Delaware": "DE",
@MatteoRagni
MatteoRagni / README.md
Last active August 12, 2017 13:14
Creates a context-menu in nautilus that allows to open a directory (or a list of selected directory) as project folder. Only for current user (no root required).

Atom context menu

Synopsis

This simple script creates a new element in context menu that opens current directory (background click) or a list of directory (selected elements) as project folder. It does not open single files (that should be done as MIME type, search on google!)

Installation