Skip to content

Instantly share code, notes, and snippets.

@Jodaille
Jodaille / audioAnalyseBatchPlotFiltered.py
Created April 23, 2024 12:57
Audio analyse < 1000Hz
import sys
import librosa
import numpy as np
import matplotlib.pyplot as plt
import glob
def analyze_audio(audio_file):
# Charger le fichier audio
y, sr = librosa.load(audio_file, sr=None)
@Jodaille
Jodaille / analyseWav.py
Created April 23, 2024 08:13
Analyse pics fichier audio
import sys
import librosa
import numpy as np
def main(audio_file):
# Charger le fichier audio
y, sr = librosa.load(audio_file, sr=None)
# Calculer la transformée de Fourier à court terme (STFT) de l'enregistrement sonore
D = np.abs(librosa.stft(y))
<?php
$imgs = glob('*.jpg');
$count = count($imgs);
echo "<div><p>Nombre d'images: {$count}</p></div>";
$directory = 'sauve_crop';
foreach ($imgs as $img) {
echo "<a href=\"/{$directory}/{$img}\" target=\"_blank\"><img src=\"/{$directory}/{$img}\" title=\"{$img}\"></a>\n";
}
@Jodaille
Jodaille / gist:392737d9dc71ea594de30a62d881a36e
Created January 31, 2024 08:28
list uncommented lines in PHP config file, ignoring line returns
# list uncommented lines, ignoring line returns
grep -v -E '^;|^$' /etc/php/8.2/fpm/pool.d/www.conf
@Jodaille
Jodaille / ViewServiceProvider.php
Created January 31, 2023 08:23
Laravel Backapack Dasboard view composer (app/Providers/ViewServiceProvider.php)
<?php
namespace App\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class ViewServiceProvider extends ServiceProvider
{
/**
@Jodaille
Jodaille / PoleEmploiActualisation.js
Created December 1, 2022 09:31
Help to fill form on actualisationenrichie.pole-emploi.fr with greasemonkey
// ==UserScript==
// @name PoleEmploiActualisation
// @version 1
// @grant GM.getValue
// @grant GM.xmlHttpRequest
// @match https://actualisationenrichie.pole-emploi.fr/actualisation/declaration/activites
// @run-at document-idle
// ==/UserScript==
const Employeur = 'Monemployeur'; // nom de l'employeur
@Jodaille
Jodaille / rtlsendmqtt.py
Created October 25, 2022 21:51
adaptation of RTL433-to-mqtt prevent too low and too high temperatures values
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import subprocess
import sys
import time
import paho.mqtt.client as mqtt
import os
import json
import re
@Jodaille
Jodaille / configuration.yaml
Last active October 27, 2023 09:38
Home Assistant mqtt sensors config Tasmota, rtl-433, Zigbee ZbBridge door sensor (/home/homeassistant/.homeassistant/configuration.yaml)
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
M5
G28; Center ?
;
;
G1 X125 Y100 F3000
;
; (square 240x240)
G1 X100 Y100 F4000
M03 S3000
M5
G1 X-125 Y-100 F3000
M03 S3000
(pause)
G4 P0.5
(square 240x240)
G1 X-125 Y120 F4000