Skip to content

Instantly share code, notes, and snippets.

View gbin's full-sized avatar

Guillaume Binet gbin

View GitHub Profile
@gbin
gbin / main.rs
Last active August 16, 2023 16:31
Mav router example based on rust-mavlink mods made by Skyways
mod clock;
mod ego;
mod keepalive;
mod mavrouter;
use clap::Parser;
use file_rotate::compression::Compression;
use file_rotate::suffix::AppendTimestamp;
use file_rotate::suffix::FileLimit;
use file_rotate::ContentLimit;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gbin
gbin / gist:41dbc2b87a985b4539982b5556e7f8c0
Created January 2, 2020 16:36
makepkg with parallelism
#
# /etc/makepkg.conf
#
#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
@gbin
gbin / test-myhdl.py
Last active December 10, 2015 17:16
from myhdl import always, always_comb, always_seq, Signal, ResetSignal, toVerilog, toVHDL, delay, traceSignals, Simulation, now, intbv, concat
def chenillar(clk, reset, leds, direction):
@always(clk.posedge)
def scroll():
if bool(direction):
leds.next = leds >> 1
if leds == 0b1:
direction.next = 0
else:
@gbin
gbin / remindme.py
Created October 4, 2015 22:46
Errbot recipes: how to persist data
from errbot import BotPlugin, botcmd
class RemindMe(BotPlugin):
@botcmd
def store(self, msg, args):
self['key'] = args
@botcmd
def recall(self, msg, args):
return self['key']
@gbin
gbin / asciiart.py
Created October 4, 2015 22:42
Errbot recipes: Webhooks
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
@webhook
def alert(self, request):
msg = request['msg']
self.send('gbin', "```\n" + Figlet().renderText('ALERT') + "\n```\n" + msg)
@gbin
gbin / asciiart.py
Created October 4, 2015 22:38
Errbot recipes: Create a poller
from datetime import datetime
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet, FigletFont
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
def activate(self):
super().activate()
self.start_poller(60, self.talking_clock) # callbacks every minute
@gbin
gbin / asciiart.py
Created October 4, 2015 22:34
Errbot recipes: Async messages
import random, time
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet, FigletFont
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
@botcmd
def big(self, mess, args):
""" Generates 3 big versions with a random font."""
for font in random.sample(FigletFont.getFonts(), 3)
@gbin
gbin / asciiart.py
Created October 4, 2015 22:31
Errbot recipes: Arguments parsing.
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet, FigletFont
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
@botcmd(split_args_with=' ')
def big(self, mess, args):
""" Generates a big version of what you want to say."""
fonts = FigletFont.getFonts()
if len(args) <= 1 or args[0] not in fonts: