Skip to content

Instantly share code, notes, and snippets.

View 3-A02YYUW.ino
/*
*@File : DFRobot_Distance_A02.ino
*@Brief : This example use A02YYUW ultrasonic sensor to measure distance
* With initialization completed, We can get distance value
*@Copyright [DFRobot](https://www.dfrobot.com),2016
* GUN Lesser General Pulic License
*@version V1.0
*@data 2019-8-28
*/
View hc-sr04.ino
const byte TRIGGER_PIN = 7; // entrée numérique 7 affectée au trig
const byte ECHO_PIN = 11; // entrée numérique 11 affectées à l'écho
const unsigned long MEASURE_TIMEOUT = 25000UL; // délais avant annulation de mesure : 25ms correspond à 8m à 340m/s
const float SOUND_SPEED = 340.0 / 1000; // Vitesse du son dans l'air en mm/us
void setup() {
Serial.begin(115200);
pinMode(TRIGGER_PIN, OUTPUT);
digitalWrite(TRIGGER_PIN, LOW);
pinMode(ECHO_PIN, INPUT);
@Hotfirenet
Hotfirenet / grocy.conf
Last active Aug 20, 2020
Installation de grocy sur une debian Buster clean
View grocy.conf
<VirtualHost *:80>
DocumentRoot /var/www/grocy/public
ErrorLog ${APACHE_LOG_DIR}/error-grocy.log
CustomLog ${APACHE_LOG_DIR}/access-grocy.log combined
<Directory "/var/www/grocy">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@Hotfirenet
Hotfirenet / OrderInvoice.php
Created Mar 23, 2020
Article HFN - Classer par marque et référence les produits dans le BL et la facture Prestashop - https://hotfirenet.com/blog/2689-classer-par-marque-et-reference-les-produits-dans-le-bl-et-la-facture-prestasop/
View OrderInvoice.php
<?php
class OrderInvoice extends OrderInvoiceCore {
public function getProductsDetail() {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT od.*, p.*, ps.*
FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = od.product_id
LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
LEFT JOIN `ps_manufacturer` m ON m.`id_manufacturer`= p.`id_manufacturer`
WHERE od.`id_order` = '.(int)$this->id_order.'
AND od.`id_order_invoice` = '.(int)$this->id .'
View installNvmCommandLine.sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
View resultUpdateRFLINKCommand.txt
vrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/djo/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.usbmodem1411
Using Programmer : wiring
View updateRFLINKCommand.sh
sudo /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -cwiring -P/dev/cu.usbmodem1411 -b115200 -D -Uflash:w:/Users/djo/Downloads/RFLink_v1.1_r48/RFLink.cpp.hex
View resetJeedomMPD.php
<?php
require_once dirname(__FILE__) . 'core/php/core.inc.php';
$user = user::byLogin('MonLogin');
$user->setPassword(sha1('monMDP'));
$user->save();
@Hotfirenet
Hotfirenet / remove_all_product_category_in_cart_rule.sql
Created Jul 25, 2019
Permet de supprimer tous les produits d'une règle panier contenu dans une categorie sur prestashop.
View remove_all_product_category_in_cart_rule.sql
DELETE FROM ps_cart_rule_product_rule_value WHERE id_item IN (SELECT id_product FROM ps_category_product WHERE id_category = 53) AND id_product_rule = 1076
@Hotfirenet
Hotfirenet / wpa_supplicant.conf
Created Jul 22, 2019
Fichier de conf pour le rpi à placer dans la partition boot
View wpa_supplicant.conf
country=FR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SSID_LAN"
psk="PASSWORD"
key_mgmt=WPA-PSK
}