Sometimes I want commands in one terminal to happen only after commands in another terminal have finished.
This is a temporary solution to a problem likely better solved by someone else somewhere :)
In one terminal:
| 'use strict'; | |
| function matchAll(re, str) { | |
| let result = [], tmp; | |
| while ( (tmp = re.exec(str)) !== null ) { | |
| tmp.shift(); | |
| result = result.concat(tmp); | |
| } | |
| return result; | |
| } |
| let basis = { | |
| hello: (name) => console.log(`hello ${name}!`) | |
| }; | |
| function wrap(fn, name, ctx) { | |
| return function() { | |
| let args = Array.prototype.slice.call(arguments); | |
| console.log(`wrapped function ${name}`, args); | |
| return fn.apply(ctx, args); |
| /** | |
| * This is an insultingly simple demo due to nerd rage | |
| * | |
| * There are claims of people using static XOR keys to hide shell code in malware | |
| * | |
| * The only thing more embarrassing than this is that it supposedly prevent detection. | |
| * | |
| */ | |
| /** | |
| * Convenience function for deep updates including searches in the path | |
| */ | |
| export default function updateIn(immutableType, pathArray, updater) { | |
| // pathArray can contain matcher functions | |
| let failed = false; | |
| let parsedPath = []; | |
| pathArray.every( (pathEl, idx) => { | |
| if (typeof pathEl !== 'function' && typeof pathEl !== 'object') { |
| 'use strict'; | |
| let objToCsv = (function() { | |
| let defaultOptions = { | |
| showLabel: true, | |
| lineBreak: '\r\n', | |
| separator: ',' | |
| }; | |
| // escape quotes |
| /** | |
| * | |
| * Late night framework experiment with @pmarabeas | |
| * | |
| */ | |
| 'use strict'; | |
| var angular = require('angular'); |
| /** | |
| * Adds a filter() method to Angular's jqlite | |
| */ | |
| (function (angular) { | |
| /** | |
| * Polyfill from MDN (mostly to cover IE9 and edge browsers) | |
| * https://developer.mozilla.org/en/docs/Web/API/Element/matches | |
| */ | |
| if (!Element.prototype.matches) { |
| /** | |
| * A dodgy and simple profiler wrapping thingy | |
| * | |
| * It don't do much, but I whipped this up as a basic helper for a coworker so may as well store for later :) | |
| * | |
| */ | |
| /** | |
| * @param {Function} fn The function you wish to profile | |
| * @param {Object} scope The 'this' property to bind |
A lightweight event system for rapid prototyping
A Pen by Keili Olsen on CodePen.