(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| # Requirement: | |
| # Linux: xdotool + convert(imagemagik) + flameshot | |
| # Mac: xdotool + imagemagick | |
| # Print out each commands and bail if there is an error | |
| set -ex | |
| CODELOC=$HOME/.sanscreenie | |
| SCRLOC="$CODELOC/screenshots" | 
| #include <FS.h> | |
| #include <ESP8266WiFi.h> | |
| #include <WiFiClientSecure.h> | |
| #include <PubSubClient.h> | |
| #include <time.h> | |
| // Insert your FQDN of your MQTT Broker | |
| #define MQTT_SERVER "mqtt.srvx1.local" | |
| const char* mqtt_server = MQTT_SERVER; | 
| #include <FastLED.h> | |
| template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = BGR, uint8_t SPI_SPEED = DATA_RATE_MHZ(24)> | |
| class APA102Controller_WithBrightness : public CLEDController { | |
| typedef SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED> SPI; | |
| SPI mSPI; | |
| uint8_t bBaseValue; | |
| void startBoundary() { mSPI.writeWord(0); mSPI.writeWord(0); } | 
| FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
| def human_log(res): | |
| if type(res) == type(dict()): | |
| for field in FIELDS: | |
| if field in res.keys(): | |
| encoded_field = res[field].encode('utf-8') | |
| print '\n{0}:\n{1}'.format(field, encoded_field) | 
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| <html> | |
| <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
| <head> | |
| <title>D3.js Dashboard Introduction</title> | |
| <script src="http://d3js.org/d3.v2.js"></script> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> | |
| <script> | |
| function getMaxObjectValue(this_array, element) { |