Skip to content

Instantly share code, notes, and snippets.

#include <AsyncHTTPSRequest_Generic.h>
#include <AsyncHTTPSRequest_Impl_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
#include <Ticker.h>
//https://www.arduino.cc/en/Tutorial/BuiltInExamples/Debounce
#include <WiFi.h> // Utilisation de la librairie WiFi.h
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <HTTPClient.h>
@samy
samy / gist:11e266c37b57a7fed2ec5f09bef6402c
Last active October 19, 2021 16:02
Une histoire au bout du fil
const char string_0[] PROGMEM = "Le petit princeLe petit princeLe petit princeLe petit prince"; // "String 0" etc are strings to store - change to suit.
const char string_1[] PROGMEM = "Le petit princeLe petit princeLe petit princeLe petit prince";
const char string_2[] PROGMEM = "Le petit princeLe petit princeLe petit princeLe petit prince";
const char string_3[] PROGMEM = "Le petit princeLe petit princeLe petit princeLe petit prince";
const char string_4[] PROGMEM = "Le petit princeLe petit princeLe petit princeLe petit prince";
const char string_5[] PROGMEM = "Le petit princeLe petit princeLe petit princeLe petit prince";
const char *const titles[] PROGMEM = {string_0, string_1, string_2, string_3, string_4, string_5};
/* Lecteur MP3 */
@samy
samy / gist:fea739e64fb373101fd8c76f249d234e
Last active May 22, 2020 11:58
Shell auto-completion script for themes and plugins list for wp-cli subcommands
_wp_complete() {
local cur=${COMP_WORDS[COMP_CWORD]}
local command=${COMP_WORDS[1]}
local subcommand=${COMP_WORDS[2]}
COMPREPLY=""
if [[ "$command" = "plugin" ]]
then
case "$subcommand" in
activate|deactivate|update|delete|get|is-active|path|status|uninstall|verify-checksums)
@samy
samy / Debug log
Last active May 19, 2020 12:13
Issue for VBoxGuestAdditions
INFO global: Vagrant version: 2.2.9
INFO global: Ruby version: 2.6.6
INFO global: RubyGems version: 3.0.3
INFO global: VAGRANT_EXECUTABLE="C:\\outils\\Vagrant\\embedded\\gems\\2.2.9\\gems\\vagrant-2.2.9\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\outils\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: C:/outils/Vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/plugins/commands/box/plugin.rb
Array
(
[action] => check_theme_updates
[installed_themes] => Array
(
[divi] => 3.0.27
[museomix] => 1.0.0
)
[class_version] => 1.0
function getACFLabel($slug)
{
$translated_post_id = icl_object_id($post->ID,'post',false,ICL_LANGUAGE_CODE);
$field = get_field_object($slug, $translated_post_id);
$value = get_field($slug, $translated_post_id);
return $field['choices'][$value];
}
@samy
samy / README.md
Created September 3, 2015 10:33
Réécriture d'URL

Problématique

Réécrire les URLs

/produit/toto

en

/produit?prod=toto
@samy
samy / clean.sh
Last active August 29, 2015 14:17
How to detect truncated MP3 files
# Retrieve MP3s list
find . -type f -iname "*.mp3" -print0 | while IFS= read -r -d $'\0' line; do
# Use sox to extract a MP3 which ends at 0 seconds of the current file
sox "$line" temp.mp3 reverse trim 0 reverse
# We retrieve original file and copy durations, as integers
ORIGINALDURATION=`sox --i -D "$line"`
ORIGINALDURATION=`printf %.0f $ORIGINALDURATION`
COPYDURATION=`sox --i -D temp.mp3`
COPYDURATION=`printf %.0f $COPYDURATION`
@samy
samy / MailCatcher Setup
Created September 9, 2014 10:19
How to use mailcatcher vith last versions of Ruby
Last versions of Ruby (>2) use i18n gem in v0.7 version
But MailCatcher seems to be incompatible with this version
@samy
samy / gist:911d77059b546d54b451
Created May 12, 2014 10:46
To download Adobe HDS videos
- use https://github.com/K-S-V/Scripts/blob/master/AdobeHDS.php
- extract .f4m URL
- php AdobeHDS.php --manifest "your_manifest_url" --delete