Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Patrick José Pereira patrickelectric

🏠
Working from home
View GitHub Profile
View elefante.vue
<template>
<span class="example">{{ msg }} - {{ potatoFunction() }}</span>
</template>
<script>
export default {
data () {
return {
msg: 'elefante!',
color: 'red',
}
View simple.sh
echo "potato, this's simple.sh!"
echo "Yes, 'it' is!"
View mavlink2rest_new_output_wip.json
{
"vehicles": [
{
"id": 1,
"components": [
{
"id": 1,
"messages": {
"RANGEFINDER": {
"type": "RANGEFINDER",
View raft.txt
// https://steamcommunity.com/app/648800/discussions/0/1694922526906474288/
// https://www.saveeditonline.com/
Arrow_Stone - 186 - 0xba
Bow - 185 - 0xb9
View create_header_string_checksum.h
#include <cstdint>
#include <cstdio>
namespace version_helper {
/**
* @brief Create the header sequence with checksum based in a string
*
* @tparam Type: Desired type of header
* @tparam N: Size of string
* @return Type: Header sequence created with checksum
@patrickelectric
patrickelectric / camera.xml
Created Sep 16, 2020
mavlink camera description file for QGC
View camera.xml
<?xml version="1.0" encoding="UTF-8" ?>
<mavlinkcamera>
<definition version="1">
<model>HD Pro Webcam C920</model>
<vendor>HD Pro Webcam C920</vendor>
</definition>
<parameters>
<parameter name="camera-mode" type="uint32" default="1" control="0">
<description>Camera Mode</description>
<options>
@patrickelectric
patrickelectric / hunter_pylinter.sh
Created Sep 2, 2020
Find all pylint checks that are failing and print human friendly name for pylintrc
View hunter_pylinter.sh
#!/usr/bin/env bash
keys=( $(pylint $(git ls-files '*.py') | rg '.*py:\d+:\d+: (.*):.*' -r '$1' | sort | uniq) )
msgs=( $(pylint --list-msgs | rg ":(.*) \(([A-Z]\d+)\).*" -r '$1,$2' | sort) )
for msg in "${msgs[@]}"; do
for key in "${keys[@]}"; do
if [[ $msg == *"$key" ]]; then
echo "${msg::-5}"
fi
done
View How to rock: Doing the right thing.md

+++ title = 'How to rock: Doing the right thing' date = 2020-08-31T13:55:39z draft = true [taxonomies] tags = [ "kde", "development", "tutorial", "how-to-rock" ] [extra] header = "/assets/how_to_rock/maintain.jpg" +++

View generate_wpa_code.py
import collections
import jinja2
import json
import re
import requests
from bs4 import BeautifulSoup
# Maybe we should generate it from wpa_cli help
class Parser():
View wpa_supplicant.py
import socket
import multiprocessing
import time
class WPASupplicant:
BUFFER_SIZE = 4096
target = ('0.0.0.0', 6664)
sock = None
process = None