(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
| // Welcome! require() some modules from npm (like you were using browserify) | |
| // and then hit Run Code to run your code on the right side. | |
| // Modules get downloaded from browserify-cdn and bundled in your browser. | |
| const delay = (t) => new Promise((resolve, reject) => { | |
| setTimeout(() => resolve(delay.DELAY), t) | |
| }) | |
| delay.DELAY = Symbol('DELAY') |
| const test = require('tape') | |
| const { createStore, combineReducers } = require('redux') | |
| const deepCombineReducers = (reducers) => | |
| combineReducers( | |
| Object.keys(reducers).reduce( | |
| (acc, key) => { | |
| const reducerOrReducers = reducers[key] | |
| return Object.assign(acc, { [key]: typeof reducerOrReducers === 'function' ? reducerOrReducers : deepCombineReducers(reducerOrReducers) }) | |
| // return { ...acc, [key]: typeof reducerOrReducers === 'function' ? reducerOrReducers : deepCombineReducers(reducerOrReducers) } |
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhFfes3sjoOjqa2Q7xnE9LZ+hpa124F7pTgKXLR2Yx5hb9D2ny0PLbnqdQdytJupGPKyaKGsL0m1JjyOaSseqf9W2A8UWXlwwFrIlAzMeJT80vYy7M7AH1LMuLZzoFs0gcyL5PfM9TQ5bU+On5beST0n/PIGb9jlxr4BbfyZ2H6ODXA6+I5qfQzkqtGgUQjA/QFh30WN7sI/JU2PhAWNg5AcmQyrgZ7NXebRfMQIXbziEpdZWLOD81WDQ4Oib7YogLl135WlyzlY7AtrHinsPuzGCv0VdZC3r47GwMSbXYsvUFiU9opxdFtlgGdY/v32RlfCEm1bNsb6y9rBcPkTLB ssh |
| alert('A bookmarlet'); |
Some npm packaged scripts are written as frameworks that dynamically require user node scripts, e.g. the gulp CLI script requires the user provided Gulpfile.js (by default).
To write .js using ES6 syntax is problematic; if the $PATH script for a framework x looks like
#!/usr/bin/env node
var x = require('x');
...
| //app.js | |
| var readline = require('readline'), rl = null, .... | |
| function startRl() { | |
| rl = readline.createInterface(process.stdin, process.stdout); | |
| rl.setPrompt('> '); | |
| rl.on('line', function (userInput) { | |
| shell.execute(userInput); | |
| rl.prompt(); |
| //cmd.js | |
| exports.invoke = function(shell, options) { | |
| shell.emit('async', function(resume) { | |
| someAsyncFn(function(result){ | |
| shell.log(result); | |
| resume(); | |
| }); | |
| //app.js |