just the bare necessities of state management.
Hotlink it from https://unpkg.com/valoo.
just the bare necessities of state management.
Hotlink it from https://unpkg.com/valoo.
Controller for an RGBW LED strip purchased from AliExpress
It only appears to fire up the RGB strip or the white strip, never both at once.
Endpoint = 0xb = 0000ffe9-0000-1000-8000-00805f9b34fb
cc2333 - fade on, to whichever output / colour was used last. Will re-fade if reissued.
cc2433 - fade off
56xxxxxxyyf0aa - change to RGB output - xxxxxx = colour code in hex. yy = anything hexy
| var gulp = require('gulp'); | |
| var browserify = require('browserify'); | |
| var babelify = require('babelify'); | |
| var source = require('vinyl-source-stream'); | |
| gulp.task('browserify', function () { | |
| return browserify('./js/app.js') | |
| .transform(babelify, {stage: 0}) | |
| .bundle() | |
| .pipe(source('bundle.js')) |
| <apex:component controller="ApprovalRequestCommentsController" access="global"> | |
| <apex:attribute name="relatedToId" assignTo="{!targetObjectId}" type="String" description="ID of the record whose last approval comments to retrieve"/> | |
| <apex:outputText value="{!comments}"/> | |
| </apex:component> |
| // Nodejs encryption with GCM | |
| // Does not work with nodejs v0.10.31 | |
| // Part of https://github.com/chris-rock/node-crypto-examples | |
| var crypto = require('crypto'), | |
| algorithm = 'aes-256-gcm', | |
| password = '3zTvzr3p67VC61jmV54rIYu1545x4TlY', | |
| // do not use a global iv for production, | |
| // generate a new one for each encryption | |
| iv = '60iP0h6vJoEa' |
| // Part of https://github.com/chris-rock/node-crypto-examples | |
| // Nodejs encryption with CTR | |
| var crypto = require('crypto'), | |
| algorithm = 'aes-256-ctr', | |
| password = 'd6F3Efeq'; | |
| function encrypt(text){ | |
| var cipher = crypto.createCipher(algorithm,password) | |
| var crypted = cipher.update(text,'utf8','hex') |
| app.get('/accounts', function(req, res) { | |
| // if auth has not been set, redirect to index | |
| if (!req.session.accessToken || !req.session.instanceUrl) { res.redirect('/'); } | |
| var query = 'SELECT id, name FROM account LIMIT 10'; | |
| // open connection with client's stored OAuth details | |
| var conn = new jsforce.Connection({ | |
| accessToken: req.session.accessToken, | |
| instanceUrl: req.session.instanceUrl | |
| }); |
| /* SF OAuth request, redirect to SF login */ | |
| app.get('/oauth/auth', function(req, res) { | |
| res.redirect(oauth2.getAuthorizationUrl({scope: 'api id web'})); | |
| }); | |
| /* OAuth callback from SF, pass received auth code and get access token */ | |
| app.get('/oauth/callback', function(req, res) { | |
| var conn = new jsforce.Connection({oauth2: oauth2}); | |
| var code = req.query.code; | |
| conn.authorize(code, function(err, userInfo) { |
| // Salesforce OAuth2 client information | |
| var oauth2 = new jsforce.OAuth2({ | |
| clientId: ‘client id string’ | |
| clientSecret: ‘client secret string’, | |
| redirectUri: 'callback url' | |
| }); |