This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var couchbase = require('couchbase'), | |
async = require('async'), | |
couchbaseConfig = { | |
debug: process.env.COUCHBASE_DEBUG || false, | |
user: process.env.COUCHBASE_USER || '', | |
password: process.env.COUCHBASE_PASSWORD || '', | |
bucket: process.env.COUCHBASE_BUCKET || 'default' | |
}, | |
bucket = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var couchbase = require('couchbase'), | |
async = require('async'), | |
request = require('request'), | |
url = require('url'), | |
path = require('path'), | |
_ = require('underscore'), | |
apiUrl = null, | |
_config = null; | |
var Bucket = function(apiUrl, config) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var couchbase = require('couchbase'), | |
async = require('async'), | |
couchbaseConfig = { | |
debug: process.env.COUCHBASE_DEBUG || true, | |
user: process.env.COUCHBASE_USER || '', | |
password: process.env.COUCHBASE_PASSWORD || '', | |
bucket: process.env.COUCHBASE_BUCKET || 'default' | |
}, | |
async = require('async'), | |
defaultHost = 'localhost:8091', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var filename = 'response-times-15min', | |
fs = require('fs'), | |
out = [], | |
i = 0, | |
array = fs.readFileSync(filename + '.tsv').toString().split('\n'); | |
for (i=0; i < array.length; i++) { | |
out.push(array[i]); | |
out.push(array[i]); | |
fs.writeFileSync(filename + '-' + i + '.txt', array[i].toString() + "\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entries = 30; | |
dataLength = 96; | |
prefix = "response-times-15min-"; | |
yScale = 0.4; | |
xScale = 0.2; | |
zScale = 0.0008; | |
union() { | |
translate([0,-entries*yScale/2,0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include the neo pixel library | |
#include <Adafruit_NeoPixel.h> | |
// how many leds in our string? | |
static const int NUM_LEDS = 6; | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_RGB Pixels are wired for RGB bitstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include the neo pixel library | |
#include <Adafruit_NeoPixel.h> | |
// how many leds in our string? | |
static const int NUM_LEDS =21*6; | |
static const int TOTAL_BYTES = NUM_LEDS*3; | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var serialport = require("serialport"), | |
SerialPort = serialport.SerialPort; | |
// first list the serial ports available so we can figure out which is the arduino | |
serialport.list(function (err, ports) { | |
var port = null; | |
ports.forEach(function(p) { | |
// this should work on windows and maybe osx | |
if (p.manufacturer.indexOf('Arduino')!==-1) { | |
port = p.comName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include the neo pixel library | |
#include <Adafruit_NeoPixel.h> | |
// how many leds in our string? | |
static const int NUM_LEDS = 5; | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_RGB Pixels are wired for RGB bitstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is all pseudocode and will probably not compile but it should give you an idea | |
// init... | |
// create your controllers | |
CLEDController controllerA = FastLED.addLEDs(LED_TYPE, DATA_PIN, COLOR_ORDER(ledsA, 0, NUM_LEDS_A); | |
CLEDController controllerB = FastLED.addLEDs(LED_TYPE, DATA_PIN, COLOR_ORDER(ledsB, 0, NUM_LEDS_B); | |
// loop.... | |
// calculate power per controller | |
uint8_t scaleA = calculate_max_brightness_for_power_mW(controllerA.leds(), controllerA.size(), targetBrightness, MAX_POWER_MW_A); |
OlderNewer