(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.
| var five = require("../lib/johnny-five.js"); | |
| var Spark = require("spark-io"); | |
| var board = new five.Board({ | |
| io: new Spark({ | |
| token: "a81cf99a8c1fe45b74d749d521a32671eb443d5e", | |
| deviceId: "53ff6f065067544840551187" | |
| }) | |
| }); |
(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.
Here is a collection of tips and tricks I've picked up about doing performance analysis on Node. Included is a build script that should get a base install of Ubuntu fully functional and ready for all the things we'll be going through.
The script pulls a lot of code from the latest master of each repository. So
it's possible that something may fail, but to date I haven't had any issues.
First, go ahead and run the script. Then go take a nice long break. It'll
| #!/bin/sh | |
| # | |
| # The MIT License | |
| # | |
| # Copyright 2014-2017 Jakub Jirutka <[email protected]>. | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| // List all files in a directory in Node.js recursively in a synchronous fashion | |
| var walkSync = function(dir, filelist) { | |
| if( dir[dir.length-1] != '/') dir=dir.concat('/') | |
| var fs = fs || require('fs'), | |
| files = fs.readdirSync(dir); | |
| filelist = filelist || []; | |
| files.forEach(function(file) { | |
| if (fs.statSync(dir + file).isDirectory()) { |
| /** | |
| * This script helps to artifically generate load on a web application through | |
| * weighted requests to various endpoints. It may not be pretty, but it works | |
| * for me. :) Feel free to use however you want. | |
| * | |
| * NOTE: Please use responsibly, don't run this script against a production server! | |
| * | |
| * @author Jordan Kasper (@jakerella) | |
| * @contributor @robcolburn | |
| * @license MIT |