+++ 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" +++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from functools import wraps | |
from typing import Any, Callable, Dict | |
def temporary_cache(timeout_seconds: float = 10) -> Callable[[Callable[[Any], Any]], Any]: | |
"""Decorator that creates a cache for specific inputs with a configured timeout in seconds. | |
Args: | |
timeout_seconds (float, optional): Timeout to be used for cache invalidation. Defaults to 10. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<span class="example">{{ msg }} - {{ potatoFunction() }}</span> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
msg: 'elefante!', | |
color: 'red', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import gi | |
sys.path.insert(0, "/usr/local/lib/python3.8/dist-packages") | |
print(sys.path) | |
#gi.require_version('Gst', '1.0') | |
from gi.repository import Gst, GstRtspServer, GObject | |
loop = GObject.MainLoop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "potato, this's simple.sh!" | |
echo "Yes, 'it' is!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"vehicles": [ | |
{ | |
"id": 1, | |
"components": [ | |
{ | |
"id": 1, | |
"messages": { | |
"RANGEFINDER": { | |
"type": "RANGEFINDER", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://steamcommunity.com/app/648800/discussions/0/1694922526906474288/ | |
// https://www.saveeditonline.com/ | |
Arrow_Stone - 186 - 0xba | |
Bow - 185 - 0xb9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |