Skip to content

Instantly share code, notes, and snippets.

View joaoantoniocardoso's full-sized avatar
🎯
Focusing

João Antônio Cardoso joaoantoniocardoso

🎯
Focusing
View GitHub Profile
@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
Created June 13, 2022 06:53
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 April 13, 2024 19:31
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 April 21, 2024 06:42
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
@patrickelectric
patrickelectric / cmds.sh
Last active March 24, 2019 17:15
Ardusub with qemu and chroot
#Download ardusub image
wget https://s3.amazonaws.com/downloads.bluerobotics.com/Pi/stable/ardusub-raspbian.img.zip
unzip ardusub-raspbian.img.zip
#mount image as device
sudo kpartx -va 0.0.10.img
sudo mkdir -p /mnt/image
#mount device partition as folder
sudo mount /dev/mapper/loop0p2 image
#move qemu inside /usr/bin
sudo cp /usr/bin/qemu-arm-static image/usr/bin