Skip to content

Instantly share code, notes, and snippets.

View MayeulC's full-sized avatar

Mayeul Cantan MayeulC

  • Lyon, France
View GitHub Profile
[0x2f4c:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=54 command_id=1>
[0x2f4c:1:0xef00] ZCL request 0x0001: [TuyaCommand(status=0, tsn=0, dp=18, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\xcc\x00\x00\x00', *payload=204))]
[0x2f4c:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=55 command_id=1>
[0x2f4c:1:0xef00] ZCL request 0x0001: [TuyaCommand(status=0, tsn=0, dp=19, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\xc0\x01\x00\x00', *payload=448))]
[0x2f4c:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=56 command_id=1>
[0x2f4c:1:0xef00] ZCL request 0x0001
@MayeulC
MayeulC / svgexport.rb
Created October 13, 2021 10:45
Klayout svg export
class SVGWriter
# Based off https://www.klayout.de/forum/discussion/873/working-with-dxfs
def initialize(file)
@file = File.open(file, "w")
@shift = 0
end
def start(w, h)
@file.puts(<<"END")
@MayeulC
MayeulC / gantt-kanboard-dump.json
Created March 22, 2021 08:56
Kanboard to frappe.io/gantt example
[{"type":"task","id":"281","title":"Simulations 1T1C pour plate-Forme de benchmark","start":[2020,8,26],"end":[2020,9,30],"column_title":"Ready","assignee":null,"progress":"25%","link":"\/tableau\/?controller=TaskViewController&action=show&project_id=12&task_id=281","color":{"name":"Teal","background":"#80cbc4","border":"#00695c"},"not_defined":true,"date_started_not_defined":true,"date_due_not_defined":false},{"type":"task","id":"285","title":"D\u00e9but PFE","start":[2018,3,15],"end":[2018,3,15],"column_title":"Done","assignee":null,"progress":"100%","link":"\/tableau\/?controller=TaskViewController&action=show&project_id=12&task_id=285","color":{"name":"Pink","background":"#f48fb1","border":"#d81b60"},"not_defined":false,"date_started_not_defined":false,"date_due_not_defined":false},{"type":"task","id":"286","title":"Fin PFE","start":[2018,9,20],"end":[2018,9,20],"column_title":"Done","assignee":null,"progress":"100%","link":"\/tableau\/?controller=TaskViewController&action=show&project_id=12&task_id=286",
@MayeulC
MayeulC / wtf.js
Created December 13, 2019 11:00
Microsoft consent fix
/* There is no way I am clicking manually trough all of these checkboxes
Outlook presented me a list of more than 500 ad and tracking providers with no way to disable them all.
The world is becoming a terrible place. GAFAM are the vilains */
// p here was obtained by opening the inspector and selecting "use in console" on the provider list
//First try:
//for (let key in p.getElementsByClassName("is-checked")) {
// p.getElementsByClassName("is-checked")[key].getElementsByTagName("button")[0].click()
@MayeulC
MayeulC / 90-thunderbird.hook
Last active August 19, 2019 09:17
Reminder to disable tbsync accounts before updating to Thunderbird 68
# Place in /etc/pacman.d/hooks/90-thunderbird.hook
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = thunderbird
Target = /usr/bin/thunderbird
[Action]
Description = Please disable TBsync accounts as per https://github.com/jobisoft/TbSync/blob/master/UPDATE68.md and delete this file (/etc/pacman.d/hooks/90-thunderbird.hook)
@MayeulC
MayeulC / combine.m
Last active November 3, 2018 09:47
Combine two images in the ycbcr (YUV) space.
% This is an Octave script that aims to easily and radically improve
% the sharpness of images from https://github.com/jantic/DeOldify
% for now, it is hand-tuned for one of the sample images
% Script output: https://imgur.com/a/n2sBYCi
pkg load image % pkg install -forge image to install
yoff = 7; % Y offset between the two images, hand-tuned to 6 or 7
im = imread('Ballerinas.jpg');
@MayeulC
MayeulC / exemple.tex
Created July 21, 2017 02:01
LaTeX: Exemple d'utilisation de la classe rapportcpe (préliminaire)
\documentclass{rapportcpe}
\usepackage[french]{babel} % Ajuster french/english au besoin. Règle certains messages comme "Table des matières"
%\usepackage{helvet} % La police Arial est conseillée
\usepackage{graphicx} % Si vous voulez inclure un logo
\usepackage[unicode]{hyperref} % Conseillé, ajoute la table des matières aux métadonnées du PDF, et des liens cliquables.
\anneestage{2016-2017} % Année du stage
@MayeulC
MayeulC / rapportcpe.cls
Created July 21, 2017 01:57
Classe LaTeX pour rapport CPE Lyon (version alpha 0.1, je ferai un dépot git propre plus tard)
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{rapportcpe}[2017/07/18 Rapport de stage pour CPE Lyon]
% Note: testé avec lualatex, vous aurez sans-doute au minimum besoin du support utf-8 sinon
% Passe toutes les options à la classe "article" et la charge
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass[a4paper]{article}
% Packets utilisés
@MayeulC
MayeulC / .zshrc
Created May 17, 2017 20:17
My .zshrc (nothing fancy, it "just works™")
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' menu select=1
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/mayeul/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall