Skip to content

Instantly share code, notes, and snippets.

View GuillaumeNachury's full-sized avatar
🏝️
I may be slow to respond.

Guillaume Nachury GuillaumeNachury

🏝️
I may be slow to respond.
  • Lyon, France
View GitHub Profile
@GuillaumeNachury
GuillaumeNachury / details.json
Created February 3, 2016 08:54
FIBARO - FGS212 Switch 3kW
{
"manufacturer": "FIBARO System",
"manufacturerid": "0x010f",
"product": "FGS212 Switch 3kW",
"producttype": "0x0402",
"productid": "0x1002",
"type": "Binary Power Switch",
"name": "",
"loc": "",
-"classes": {
Initialising OpenZWave 1.4.9 binary addon for Node.JS.
OpenZWave Security API is ENABLED
ZWave device db : /usr/local/etc/openzwave/
User settings path : /home/pi/dev/HomeController/node_modules/openzwave-shared/build/Release/../../
Option Overrides : --Logging true --ConsoleOutput true
2016-02-15 19:07:41.026 Always, OpenZwave Version 1.4.9 Starting Up
2016-02-15 19:07:41.027 Info, Setting Up Provided Network Key for Secure Communications
2016-02-15 19:07:41.027 Warning, Failed - Network Key Not Set
2016-02-15 19:07:41.027 Info, mgr, Added driver for controller /dev/ttyUSB0
2016-02-15 19:07:41.028 Info, Opening controller /dev/ttyUSB0
[
{
"_id": "57c54904d9857a5c991b761b",
"firstname": "Sampson",
"lastname": "Cunningham",
"company": "STUCCO"
},
{
"_id": "57c54904b5a930d9d439401a",
"firstname": "Dorsey",
@GuillaumeNachury
GuillaumeNachury / LTP.md
Last active November 7, 2016 09:45
LT Protocol

Structure d'une trame ( 8 bytes )

SRC DST CMD FREQ DATA 1 DATA 2 DATA 3 DATA 4
1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte

SRC : Adresse de l'emetteur.

DST : Adresse du module à qui est transmis la message.

@GuillaumeNachury
GuillaumeNachury / player.js
Created June 9, 2017 12:49
Mac OS terminal music player
const fs = require('fs');
const spawn = require('child_process').spawn;
var files = [];
fs.readdir('./', (err, data) => {
files = data.filter((f)=> f.match('mp3') != null);
playRandomFile();
});
function playRandomFile(){
let aFamily = [{name:"Veronique", age:34},{name:"Arthur", age:4},{name:"Guillaume", age:35}];
function getSortedFamily(){
return aFamily.sort((a,b)=>a.age - b.age);
}
getSortedFamily();
@GuillaumeNachury
GuillaumeNachury / async_middleware_redux.js
Created June 13, 2018 09:46
Redux Async middleware - Add a convient way to dispatch new action from an action
const asyncDispatcMiddleware = store => next => action => {
let syncActivityFinished = false;
let actionQueue = [];
function flushQueue() {
actionQueue.forEach(a => store.dispatch(a));
actionQueue = [];
}
function asyncDispatch(asyncAction) {