aspe:keyoxide.org:K6WIAZ367UAX72YPYQWLCPQWZE
Updated version of the posted sql referenced in clone schema on the PostgreSQL wiki to work with PostgreSQL 15+.
SELECT clone_schema('public', 'pappyclone', TRUE);| // just using the module as the closure | |
| let count = 1; | |
| export function counter() { | |
| return count++; | |
| } |
It is as it sounds: this function will create something similar to an enum (in this case, an object with a null prototype) from a tuple of string literals.
Even though native enums have some convenient benefits, they can get a little "wordy" when you wish them to work like holders of string constants.
This will return the IPv4 or IPv6 address of the client making the GET request to the domain you specified when making
the CloudFront distribution. If you add an Accept header with application/json present, it will return an json-parseable
object like { "ip": "127.0.0.1" }, but if not specified or text/plain appears before application/json, it will
default to text/plain and just return the IP address like 127.0.0.1 (following standard handling of Accept headers).
I hereby claim:
- I am brandonpapworth on github.
- I am brandonpapworth (https://keybase.io/brandonpapworth) on keybase.
- I have a public key ASAM9NUHKV50RBstYCEF7Tk2MKzG-8kqshOVgd0LqjN2mQo
To claim this, I am signing this object:
| var _toString = Object.prototype.toString; | |
| var _getPrototypeOf = Object.getPrototypeOf; | |
| function isPlainObject(value) { | |
| switch(value) { | |
| default: | |
| if (_toString.call(value) === '[object Object]') { | |
| break; | |
| } | |
| case null: |
| const complaints = Complaints.find({status: 'pending'}); | |
| // An object with keys of <Complaint.objectId> and values of {complaint<Complaint>, count<Number>} | |
| // Will dedupe complaints as well as track the number of times they appear. | |
| const complaintStore = complaints.reduce((complaintStore, complaint) => { | |
| if (complaintStore[complaint.objectId]) { | |
| // Already encountered this complaint, so just increment the counter | |
| complaintStore[complaint.objectId].count += 1; | |
| } else { | |
| // First time seeing this complaint, so initialize the container and store it |
How to determine if it should be active/inactive
- AC Current Sensor
- Gravity: Analog AC Current Sensor: Will be used to detect if the AC unit is currently "on" and active
- Gravity: I2C ADS1115 16-Bit ADC Module: Needed for converting analog signal from AC current sensor for Raspberry Pi