Skip to content

Instantly share code, notes, and snippets.

View natcl's full-sized avatar

Nathanaël Lécaudé natcl

View GitHub Profile
@natcl
natcl / docker-compose.yml
Last active June 18, 2020 19:00
Node-RED + InfluxDB + Grafana + Mongo
version: '2'
services:
nodered1:
depends_on:
- mosquitto
image: nodered/node-red-docker:0.17.5
ports:
- "1884:1880"
restart: always
@natcl
natcl / midiParser.js
Created June 23, 2017 15:12
Very basic midiParser for Node-RED
var midiTypes = {
'8': 'noteoff',
'9': 'noteon',
'10': 'polyat',
'11': 'controlchange',
'12': 'programchange',
'13': 'channelat',
'14': 'pitchbend'
};
@natcl
natcl / Node-RED_file_upload.json
Last active September 29, 2022 04:33
Node-RED file upload example with built-in http in node.
[
{
"id": "f1ffeb7e.f6451",
"type": "http in",
"z": "c29865fe.249648",
"name": "",
"url": "/upload",
"method": "get",
"upload": false,
"swaggerDoc": "",
@natcl
natcl / Node-RED LFO.js
Last active February 13, 2017 17:35
Node-RED LFO
var osc = global.get('osc');
var clock = global.get('sincewhen');
var result;
if (msg.hasOwnProperty('freq')) {
context.freq = msg.freq;
return;
}
if (msg.wave) {
@natcl
natcl / node-red-ramp.js
Last active January 18, 2017 10:12
Node-RED ramp
function ramp() {
if (to > from) {
if (context.count >= to) {
clearInterval(context.rampInterval);
context.rampInterval = null;
context.count = from - 1;
return;
}
context.count = context.count += 1;
@natcl
natcl / flows.json
Created October 14, 2016 15:07
Node-RED fa-icon color change
[
{
"id": "40050c8a.de271c",
"type": "inject",
"z": "a68c389e.596268",
"name": "Vert",
"topic": "press",
"payload": "<i class=\"fa fa-circle fa-2x nr-dashboard-ok\"></i>",
"payloadType": "str",
"repeat": "",
@natcl
natcl / ternary.js
Created June 4, 2016 01:54
Ternary JavaScript example with Node-RED
setInterval(() => {
msg.payload = msg.payload == 'BLUE' ? 'RED' : 'BLUE';
node.send(msg);
}, 1000);
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
# bind key for synchronizing panes
bind-key S set-window-option synchronize-panes
set -g mouse on
cd /home/pi/source/2015_chandler/node-red
sudo pm2 stop node-red
npm install
sudo pm2 start node-red
@natcl
natcl / fullcalendar.json
Last active January 4, 2016 22:20
FullCalendar + Node-RED example
[
{
"id": "dc8fd660.237028",
"type": "websocket-listener",
"z": "c5b2c450.3a4d38",
"path": "/calendar",
"wholemsg": "false"
},
{
"id": "cb2fc39d.34d04",