Skip to content

Instantly share code, notes, and snippets.

View albertkim's full-sized avatar

Albert Kim albertkim

View GitHub Profile
@PhantomRay
PhantomRay / app.js
Last active February 11, 2023 02:33
Read data from Dymo M10 scale using nodejs in Windows.
var HID = require('node-hid'),
usb = require('usb');
var reading = false,
interval,
vid = 0x922,
pid = 0x8003;
// try to connect to the scale if available
startReading();
@dinana
dinana / useDeepPopulate.js
Last active June 13, 2019 08:33
Util Sails Service with PopulateDeep function
User.find(id).populate('preferences').exec(function (err, user) {
if(err) {
sails.log.error("ERR:", err);
}
sails.services['util'].populateDeep('user', user[0], 'preferences.nestedPreferences', function (err, newUser) {
if (err) {
sails.log.error("ERR:", err);
}
console.log(newUser);
});