Skip to content

Instantly share code, notes, and snippets.

FcgDam fcgdam

  • Lisbon, Portugal
Block or report user

Report or block fcgdam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fcgdam
fcgdam / PostgresMiddleware.js
Created Aug 13, 2019 — forked from DJviolin/PostgresMiddleware.js
Node.js Postgres Redis query caching with variable expiration
View PostgresMiddleware.js
/**
* PostgresMiddleware.js
*
* Handles postgres queries and caching to redis
* see README for usage
*
*/
var pg = require('pg'),
crypto = require('crypto'),
@fcgdam
fcgdam / flow.js
Created Jul 25, 2019
Node-Red flow for PowerMeter
View flow.js
[{"id":"c69b35de.5b1288","type":"tab","label":"Power Meter Dash","disabled":false,"info":"Power Meter DashBoard"},{"id":"11b29614.713a5a","type":"mqtt in","z":"c69b35de.5b1288","name":"PM Telemetry","topic":"iot/device/ESP8266_PowerMeter/telemetry","qos":"2","datatype":"auto","broker":"2a552b3c.de8d2c","x":140,"y":60,"wires":[["4f01e095.a6b468"]]},{"id":"4f01e095.a6b468","type":"json","z":"c69b35de.5b1288","name":"To JSON","property":"payload","action":"","pretty":false,"x":350,"y":60,"wires":[["3afc46aa.19ff9a","b4966155.90ad9","4e1496c4.95576","2cdca24.0a446de","3c7e559f.3df0ea","db4513ed.467ef8"]]},{"id":"3afc46aa.19ff9a","type":"function","z":"c69b35de.5b1288","name":"Voltage (V)","func":"msg.payload = Number(msg.payload.V);\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":60,"wires":[["c2e720c3.2121d","f13ac150.bfe46"]]},{"id":"b4966155.90ad9","type":"function","z":"c69b35de.5b1288","name":"Current (I)","func":"msg.payload = Number(msg.payload.I);\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":120,"wires
@fcgdam
fcgdam / gist:bb67f8c4154f0068c02172662eed0cab
Created Nov 24, 2018
Node-Red Crypto-js configuration
View gist:bb67f8c4154f0068c02172662eed0cab
functionGlobalContext: {
// os:require('os'),
// octalbonescript:require('octalbonescript'),
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false})
gcm:require('node-gcm'),
cryptojs:require('crypto-js')
},
@fcgdam
fcgdam / arch_installation.md
Last active Nov 24, 2018 — forked from alexBeuth/arch_installation.md
Arch Linux installation
View arch_installation.md

WARNING: WORK IN PROGRESS, USE THESE STEPS WITH CAUTION. IT WILL CLEAR ALL DISK DATA!!

I recommend first to use a Virtual Box machine with EFI support enabled to test everything before doing it on a real machine.

Arch installation on a HP ENVY 13 inch laptop (ah0006np part number: 16GB Ram, 512GB SSD)

OBJECTIVE: Install Arch Linux with encrypted boot, root and swap filesystems and boot from UEFI, completly dumping Windows on the process. No dual boot. Windows, if necessary will be run on a Virtual Machine and re-use the Windows key that came with the laptop.

The configuration will be LVM on LUKS. Also a major difference from other tutorials is that the boot partition is also encrypted, and not a standard partition.

@fcgdam
fcgdam / template.js
Created May 10, 2018
Node-Red Status indicator Template code
View template.js
<style>
.dot {
height: 25px;
width: 25px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
float: right;
}
</style>
You can’t perform that action at this time.