-
Install and run an MQTT server (mosquitto is a good choise)
-
Install mqtt and ncurses-ruby gems
sudo gem install ruby-mqtt ncurses-ruby
-
Run the client
ruby ./mqtt-chat.rb
#To visualize branches: | |
git branch | |
#To create a new branch: | |
git branch testbranch | |
#To change to created branch: | |
git checkout testbranch | |
#Track new files: |
(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.
const Promise = require("bluebird"); | |
const request = require("request-promise"); | |
const ID3Writer = require('browser-id3-writer'); | |
const crypto = require('crypto'); | |
const format = require('util').format; | |
const fs = require("fs"); | |
const http = require('http'); | |
// Download a deezer song / playlist / album |
With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.
This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async
+ await
.
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
const facebook = require("facebook-chat-api"); | |
const birthdayWishes = require("./birthday-wishes.json"); | |
const schedule = require("node-schedule"); | |
const fs = require("fs"); | |
function sendGreetings() { | |
facebook( | |
{ email: process.env.USERNAME, password: process.env.PASSWORD }, | |
(error, api) => { | |
if (error) throw error; |
#!/bin/bash | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-cache policy docker-ce | |
sudo apt-get install -y docker-ce | |
sudo systemctl status docker | |
sudo usermod -aG docker ${USER} | |
id -nG |