function createUl(ulSize, depth, maxDepth){
var ul = document.createElement('ul');
for (var i = 0; i < ulSize; i++){
var li = document.createElement('li');
ul.appendChild(li);
li.textContent = 'Hi ' + depth + '.' + i;
if (depth < maxDepth){
li.appendChild(createUl(ulSize, depth + 1, maxDepth));
}| var SauceLabs = require('saucelabs'); | |
| var myAccount = new SauceLabs({ | |
| username: "...", | |
| password: "..." | |
| }); | |
| myAccount.getJobs(function (err, jobs) { | |
| jobs.forEach(function(job){ | |
| myAccount.send({ |
'a-big-bad-directive'.replace(/-(.)/g, function(a, b){
return b.toUpperCase();
});Simply expose a global (eg in main.js)
window.au = el => {
let aureliaNode = el;
// go up the structure until an element affected by aurelia is found
while (aureliaNode !== null && aureliaNode !== undefined && aureliaNode.au === undefined) {
aureliaNode = aureliaNode.parentNode;
}Simply expose a global (eg in main.js)
window.au = el => {
let aureliaNode = el;
// go up the structure until an element affected by aurelia is found
while (aureliaNode !== null && aureliaNode !== undefined && aureliaNode.au === undefined) {
aureliaNode = aureliaNode.parentNode;
}| import { Observable, Subscriber} from 'rxjs'; | |
| const _lift = Observable.prototype.lift; | |
| function LogOperator(childOperator) { | |
| this.childOperator = childOperator; | |
| } | |
| LogOperator.prototype.call = function (subscriber) { | |
| return this.childOperator.call(new LogSubscriber(subscriber)); | |
| }; |
| var gaze = require('gaze'); | |
| var Rx = require('rxjs'); | |
| var spawn = require('child_process').spawn; | |
| // Watch all .js files/dirs in process.cwd() | |
| gaze([ | |
| './src/**/*.js', | |
| './src/*.js' | |
| ], | |
| function(err, watcher) { |
JSPM is making some terrible choices IMO.
-
Doesn't use npm the CLI, instead it uses NPM the http registry
there is a very high chance that developers using JSPM also use NPM. Now their NPM packages might get installed in
node_modulesorjspm_packageseven though they are the same package. They also need to understand how the jspm npm-registry works if anything goes wrong even though they already know how NPM works.there are
goodreasons they are doing this... but I am not convinced those reasons are worth it. In other words, I would rather see more complexity in JSPM to abstract this way, than more complexity on the consumer (as noted above). -
Uses both git the CLI and github's http api for the git registry
| /******/ (function(modules) { // webpackBootstrap | |
| /******/ // The module cache | |
| /******/ var installedModules = {}; | |
| /******/ // The require function | |
| /******/ function __webpack_require__(moduleId) { | |
| /******/ // Check if module is in cache | |
| /******/ if(installedModules[moduleId]) | |
| /******/ return installedModules[moduleId].exports; |
| import { observable, observe, transaction, computed, reaction } from 'mobx'; | |
| import expect, { createSpy } from 'expect'; | |
| describe('learning mobx', () => { | |
| it('some mobx basics', () => { | |
| const computedSpy = createSpy(); | |
| const o1 = observable(1); | |
| const o2 = observable(10) | |
| const o3 = observable(() => { |