This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const bluebird = require('bluebird'); | |
| const co = require('co'); | |
| const fs = bluebird.promisifyAll(require('fs')); | |
| const _ = require('lodash'); | |
| function lsPromise() { | |
| return co(function* () { | |
| let paths = { current: '.', root: '/' }; | |
| return yield _.mapValues(paths, path => fs.readdirAsync(path)); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt-get -y install wget | |
| cd /tmp | |
| wget http://nodejs.org/dist/v0.10.22/node-v0.10.22-linux-x64.tar.gz | |
| tar -zxf node-v0.10.22-linux-x64.tar.gz | |
| rm node-v0.10.22-linux-x64.tar.gz | |
| mkdir /usr/local/node | |
| mv node-v0.10.22-linux-x64 /usr/local/node/0.10.22 | |
| ln -s /usr/local/node/0.10.22/bin/node /usr/local/bin/node | |
| ln -s /usr/local/node/0.10.22/bin/npm /usr/local/bin/npm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bottle import get, run, request, post, Bottle, abort, error, response, debug, redirect | |
| # This is a dictionary endpoint. It retrieves definitions for words. | |
| # You can also add words to the dictionary. | |
| # this allows our bottle application to be accessible outside this file | |
| app = Bottle() | |
| dictionary = { | |
| "lugubrious": "extremely sad", |