Skip to content

Instantly share code, notes, and snippets.

View joaoantoniocardoso's full-sized avatar

João Antônio Cardoso joaoantoniocardoso

View GitHub Profile
@Williangalvani
Williangalvani / build.md
Last active May 15, 2025 20:07
bulding and debugging ardusub dev with gcc 10.2 for navigator

Instructions for building and debugging ArduSub in Blueos

This uses a fixed gcc version, 10.2, as that is what ardupilot is using, and seems to play along fine with glibc and gdbserver in blueos.

10.3 WILL NOT WORK IN BLUEOS

wget --no-clobber http://new.galvanicloop.com:8000/gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf.tar.xz
tar -xxvf gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf.tar.xz
git clone --recurse-submodules --branch Sub-4.1 https://github.com/ArduPilot/ardupilot.git
@patrickelectric
patrickelectric / pub-sub-ros.md
Last active July 25, 2022 21:56
My personal investigation on the pub/sub frameworks around the world!

ROS

Long and love-rate (more rate than love) relationship, take mostly of this review with a grant of salt.

Great tools, libraries and projects

ROS (started in 2010) have some great tools visualize topics, send and debug messages, check frequencies, and much more. It's also possible to use more advanced tools and solutions like: rviz, gmapping, rtabmap, stereo_image_proc and the list goes on. With ROS, it's possible to take advantage of all drivers that exist for different pieces of hardware. Keep in mind that this is possible, but not easy, usually the drivers need specific configuration, custom settings and may give as output really complex data that needs to be processed or analyzed by another program.

Bureaucratic

ROS uses [catkin](https://github.com

@Paraphraser
Paraphraser / Checking your Raspberry Pi's view of its power supply.md
Last active July 11, 2025 18:02
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@denniskupec
denniskupec / rules.txt
Created June 5, 2021 23:17
KiCad DRC rules for JLCPCB, 4-layer PCB
(version 1)
# 4-layer, 1oz copper
(rule "Minimum Trace Width and Spacing (inner layer)"
(constraint track_width (min 5mil))
(constraint clearance (min 5mil))
(layer inner)
(condition "A.Type == 'track'"))
(rule "Minimum Trace Width and Spacing (outer layer)"
@strfry
strfry / gist:422b83f7d6e695c9bc1d55f3b4d2a6d1
Last active March 27, 2025 04:49
v4l2loopback example
#!/bin/sh -e
# Dependencies
apt install -y v4l2loopback-dkms v4l2loopback-utils gstreamer1.0-plugins-good
apt install -y gstreamer1.0-plugins-bad # h264parse
apt install -y gstreamer1.0-libav # H.264
# Reset module state
modprobe -r v4l2loopback
modprobe v4l2loopback
@maxkostinevich
maxkostinevich / index.html
Last active June 28, 2025 15:51
Cloudflare Worker - Handle Contact Form
<!--
/*
* Serverless contact form handler for Cloudflare Workers.
* Emails are sent via Mailgun.
*
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
@patrickelectric
patrickelectric / moving_average.cpp
Last active January 8, 2020 19:11
moving average filter
/**
* @brief Helper struct to do a moving average
* Ref: https://en.wikipedia.org/wiki/Moving_average
*
* @tparam T
*/
template <typename T> struct MovingAverage {
/**
* @brief Update average
*
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@bencholmes
bencholmes / cascadeSSM.m
Last active June 17, 2019 02:40
A function to cascade linear state-space matrices for the purpose of cascading filters etc.
function [Ac,Bc,Cc,Dc] = cascadeSSM(A,B,C,D)
% CASCADESSM A function to cascade linear state-space matrices for the
% purpose of cascading filters etc.
%
% Author: Ben Holmes
% Date: 2018/05/20
% License: GPL V3
%
% This function is derived from the answer
% https://math.stackexchange.com/questions/2201067/cascade-of-state-space-models-for-linear-systems
@jameswpm
jameswpm / pomodoro.sh
Last active December 27, 2023 15:53
Minimalistic Pomodoro Timer
#!/bin/bash
#
# Minimalistic_Pomodoro_Timer
#
# Based on the SU answer found here: https://superuser.com/questions/224265/pomodoro-timer-for-linux/669811#669811
#
# Tested in Ubuntu 16.04 and Arch
pomodorotime () {
notify-send "Time to Work" "Focus" -u normal -a 'Pomodoro' -i $HOME/Documentos/icon.png
paplay /usr/share/sounds/freedesktop/stereo/window-attention.oga