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
| import parser from 'uri-template'; | |
| function buildURL(url, data) { | |
| const uriTemplate = parser.parse(url); | |
| return uriTemplate.expand(data); | |
| } | |
| function immutableFetchHypermediaRecursive(root, paths = [], data = {}) { | |
| return fetch(root).then((partResponse) => { |
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
| window.addEventListener('codebasket:ready', function() { | |
| var terminal = _.find(codeBasket.items, function(item) { return item.type === 'terminal' }), | |
| currentConsole = CodePicnic.consoles["flask-id-example"]; | |
| terminal.location = currentConsole.console.terminalUrl + '?token=' + currentConsole.console.terminalToken; | |
| terminal.tabPage.refs.frame.addEventListener('load', function() { | |
| codeBasket.send('ls -la'); | |
| codeBasket.on('pty:data', function(message) { | |
| console.log(ansi_up.ansi_to_text(message.data)); | |
| }); |
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
| post '/lessons/:id/test' do | |
| content_type :json | |
| session_id = "console_lesson_#{params[:id].gsub(/-/, '_')}".to_sym | |
| @token = CodePicnic.token | |
| @console = CodePicnic::Console.new(container_name: session[session_id]) | |
| logger.info @console.container_name | |
| input_file = Tempfile.new('input.js') | |
| input_file.write(params[:input]) |
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
| function addLibrary(newConsole, library) { | |
| newConsole.libraries.push(library); | |
| var libs = newConsole.bites[0].preTag.dataset['libs'] || ''; | |
| libs = libs.split(';'); | |
| if (libs.length === 1 && libs[0] === '') { | |
| libs.length = 0; | |
| } |
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
| function buildUI(newConsole) { | |
| var fragment = document.createDocumentFragment(), | |
| fragmentRoot = document.createElement('section'); | |
| fragmentRoot.className = 'bite-container'; | |
| fragmentRoot.id = 'bite-container-' + newConsole.name; | |
| var fragmentRootHTML = ''; | |
| fragmentRootHTML += '<aside class="bite-container-sidebar-container">'; |
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
| var ansi = require('ansi_up'), | |
| framebus = require('framebus'), | |
| prompts = require('./constants').prompts, | |
| ansiToText = ansi.ansi_to_text, | |
| newLinePrompts = require('./constants').newLinePrompts; | |
| function sendCommandBatch(batch) { | |
| this.commands = batch; | |
| this.sendCommandInput(this.commands.shift()); | |
| } |
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
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| [ -z "$PS1" ] && return | |
| # don't put duplicate lines in the history. See bash(1) for more options | |
| # ... or force ignoredups and ignorespace | |
| HISTCONTROL=ignoredups:ignorespace |
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
| Bo Bayles | |
| [email protected] | |
| observable.net | |
| github.com/obsrvbl | |
| https://observable.net/company/resources/aws-meetup-boston-2016-slides/ | |
| no encryption: dpi is possible | |
| encryption: dpi is impossible | |
| dpi: deep packet inspection |
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
| caniuse.com | |
| github.com/search?q=feature+polyfill -> sort by stars | |
| <a download="foo.js"> | |
| <a href="application/octet-stream,alert('foo')"> | |
| <input type="file" multiple accept="image/png"> -> HTML 4 | |
| <input type="file" multiple accept="image/*"> -> HTML 5 | |
| <input type="file" multiple accept=".png, .jpg, .gif"> -> HTML 5 |
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
| { | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "node_modules/.bin/mocha", | |
| "build:css": "node_modules/.bin/node-sass app/assets/sass/index.scss public/css/index.css", | |
| "watch:css": "node_modules/.bin/nodemon -e scss -x \"npm run build:css\"", | |
| "build:js": "browserify app/assets/javascripts/index.js -t babelify -o public/js/index.js --debug --verbose", | |
| "watch:js": "watchify app/assets/javascripts/index.js -t babelify -o public/js/index.js --debug --verbose", | |
| "start": "node_modules/.bin/parallelshell \"npm run watch:js\" \"npm run watch:css\" \"node_modules/.bin/nodemon index.js\"" | |
| }, |