(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.
(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.
| // For quickly trying things out in the browser, jQuery and Lo-Dash (like Underscore.js) are great. | |
| // Read the code below (never copy & paste code you don't trust), | |
| // then you can copy & paste it into the browser console to load jQuery & lodash. | |
| (function () { | |
| var jq = document.createElement('script'); | |
| jq.src = 'https://code.jquery.com/jquery-2.1.4.js'; |
| var https = require('https'); | |
| var util = require('util'); | |
| exports.handler = function(event, context) { | |
| console.log(JSON.stringify(event, null, 2)); | |
| console.log('From SNS:', event.Records[0].Sns.Message); | |
| var postData = { | |
| "channel": "#aws-sns", | |
| "username": "AWS SNS via Lamda :: DevQa Cloud", |
Below is a quick start guide to developing node.js on OSX. These tools and settings will give you just about everything you would need on a clean install of OSX 10.10.X to get setup and coding.
| _.jsonp('https://api.ipify.org/?format=jsonp', function(err, value){ | |
| console.log(err || value); | |
| }); |
| Finding keys and values | |
| Objects, in Vanilla JavaScript, use the same syntax as arrays | |
| for accessing property | |
| values.That is, the square bracket notation but typically with a human - readable | |
| string, instead of a numerical index.However, the same issues that exist with | |
| numerical indices and arrays exist with objects and keys too.Just because the key | |
| is a string doesn 't mean that we know which keys are available. Sometimes, we | |
| have to search the object to find the key we 're looking for. | |
| We use the findKey() | |
| function to locate the key of the first object property that |
| # See list of docker virtual machines on the local box | |
| $ docker-machine ls | |
| NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS | |
| default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1 | |
| # Note the host URL 192.168.99.100 - it will be used later! | |
| # Build an image from current folder under given image name | |
| $ docker build -t gleb/demo-app . |
| { | |
| "presets": [ "es2015" ] | |
| } |
| // Create a Promise that resolves after ms time | |
| var timer = function(ms) { | |
| return new Promise(resolve => { | |
| setTimeout(resolve, ms); | |
| }); | |
| }; | |
| // Repeatedly generate a number starting | |
| // from 0 after a random amount of time | |
| var source = async function*() { |