Le but ici est de produire un périphérique pour détecter la présence d'une puce RFID à longue distance (minimum 30cm) et qui soit capable d'envoyer l'information à un
This file contains hidden or 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 bs4 | |
from pygments import highlight | |
from pygments.lexers import HtmlLexer | |
from pygments.filters import VisibleWhitespaceFilter | |
from pygments.formatters import HtmlFormatter | |
from django import template | |
from django.conf import settings | |
from django.utils.safestring import mark_safe |
This file contains hidden or 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
""" | |
Proof of concept to programmatically build a Python module using "ast" module. | |
The concept is that we would have to define specialized class for each of module to | |
build (model module, model "__init__" ? view, url, test (sic) etc..). This is a | |
workaround using Jinja to write code that demonstrated some limit (with the spaces and | |
indentations is a huge pain). | |
Actually this is laboratory stuff to see if a basic module with imports, class, method | |
can be easily script. If it works, we will need to have a base abstract class to help |
This file contains hidden or 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
<!-- Click to action to open video into modal, 'A_YOUTUBE_URL' should be any video URL from Youtube --> | |
<button type="button" class="video-to-modal" data-siteyb-url="A_YOUTUBE_URL"> | |
Watch the video | |
</button> | |
<!-- The Bootstrap Modal container dedicated to embed video --> | |
<div class="modal" id="videoToModal" tabindex="-1" aria-labelledby="videoToModal" aria-hidden="true"> | |
<div class="modal-dialog modal-xl modal-fullscreen-xl-down overflow-hidden"> | |
<div class="modal-content"> | |
<div class="modal-header"> |
This file contains hidden or 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
""" | |
A commandline script to get project dependencies informations using Libraries.io API. | |
This requires a valid API key from 'Libraries.io' that you can get just by register | |
to the site itself, you will need to write it to a file to give as command argument. | |
Requirements: | |
* requests>=2.32.3; | |
* semantic-version>=2.10.0; |
This file contains hidden or 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
""" | |
This is a demonstration and tutorial for "schema" library until its implementation is | |
finished since library documentation is painful to understand. | |
Schema validate data values and possibly coerces them if instructed to do so. | |
Basically schema respect given scheme structure. A callable item (like list or dict) is | |
followed recursively, a type object (like int or str) expect a value in this right type | |
and almost everything (like "foo" or 42) else is assumed as an exact value expected. |
This file contains hidden or 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
""" | |
Proof of concept script to use MediaInfo to get metadatas from a video file. | |
Although this script have been done only for videos, MediaInfo also allow to read infos from audio and images. | |
First, this have been done with Python 3.10 but it should probably work with Python 3.8 | |
MediaInfo library is required to be installed on your system, see: | |
https://github.com/MediaArea/MediaInfo |
This file contains hidden or 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
In Python 3, this mental model is pretty straight-forward: | |
Encoding is the process of converting a str to a bytes object | |
Decoding is the process of converting a bytes object to a str | |
┏━━━━━━━┓ ┏━━━━━━━┓ | |
┃ ┃ -> encoding -> ┃ ┃ | |
┃ str ┃ ┃ bytes ┃ |
This file contains hidden or 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
""" | |
This requires ``Python>=3.8`` and ``packaging>=23.1``. | |
""" | |
from importlib.metadata import requires | |
from pathlib import Path | |
from packaging.requirements import Requirement | |
class RequirementBuilder: |
This file contains hidden or 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
help: | |
@echo "Please use 'make <target> [<target>...]' where <target> is one of" | |
@echo | |
@echo " Cleaning" | |
@echo " ========" | |
@echo | |
@echo " clean -- to clean EVERYTHING" | |
@echo |
NewerOlder