Update slides

master
Buddy Sandidge 10 years ago
parent 41788bbd59
commit ca14db930d

@ -0,0 +1,14 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
root.Backbone = factory(root, exports, _, $);
});
} else if (typeof exports !== 'undefined') {
var _ = require('underscore');
factory(root, exports, _);
} else {
root.Backbone = factory(root, {}, root._, root.$);
}
}(this, function(root, Backbone, _, $) {
// Backbone…
}));

@ -0,0 +1,7 @@
var phantom = phantom || {exit: function () {}};
var _ = require('../../vendor/underscore/underscore');
phantom.injectJs('../../vendor/backbone/backbone.js');
console.log(_.toString());
console.log(Backbone.View.toString());
phantom.exit();
//module.exports = Backbone;

@ -1,8 +1,8 @@
function onLoad() {
console.log(this.responseText);
}
var request = new XMLHttpRequest();
request.onload = onLoad;
request.open('get', 'http://localhost:8000/', true);
request.send();
var phantom = this.phantom || {exit: function () {}};
var page = require('webpage').create();
// code, code, code…
page.open('about:blank', function () {
page.close();
console.log('☮ out!');
phantom.exit();
});

@ -1,4 +1,4 @@
(function (phantom) {
var phantom = this.phantom || {exit: function () {}};
console.log('bind:', typeof Function.prototype.bind);
console.log('9 === parseInt("09"):', 9 === parseInt('09'));
@ -7,7 +7,4 @@
console.log('filter:', typeof Array.prototype.filter);
console.log('Object.create:', typeof Object.create);
if (phantom) {
phantom.exit();
}
}(this.phantom));

@ -0,0 +1,5 @@
describe('some test', function () {
it('→ some test case', function () {
expect(1 + 1).toBe(2);
});
});

@ -0,0 +1,15 @@
phantom.injectJs('../../vendor/jasmine/lib/jasmine-core/jasmine.js');
var consoleFns = require('../../vendor/jasmine/lib/console/console.js');
var jasmine = jasmineRequire.core(jasmineRequire);
consoleFns.console(consoleFns, jasmine);
var globals = jasmineRequire.interface(jasmine, jasmine.getEnv());
for (var property in globals) this[property] = globals[property];
jasmine.getEnv().addReporter(new jasmine.ConsoleReporter({
print: function print(msg) { console.log(msg); },
onComplete: function exit(success) { phantom.exit(success ? 0 : 1); }
}));
phantom.injectJs('./some-test.js');
jasmine.getEnv().execute();

@ -1,10 +1,9 @@
(function (phantom) {
var phantom = this.phantom || {exit: function () {}};
var foo = {bar: {baz: 123}};
delete foo.bar;
try {
console.log(foo.bar.baz);
} catch (err) {
console.log(err);
phantom && phantom.exit();
phantom.exit();
}
}(this.phantom));

@ -0,0 +1,6 @@
# Sharing is Caring
- Global variables
- CommonJS
- AMD
- ES6 modules

@ -0,0 +1,5 @@
# Use After Free
- Create webpage object in JavaScript
- Close webpage in JavaScript
- Do something with webpage in JavaScript

@ -0,0 +1,2 @@
# Thanks!
## Q&A

@ -0,0 +1,6 @@
# More goodies
- The `--remote-debugger-port [debug-port]` flag
- Web server module
- Use a WebSocket in a webpage
- So much awesomeness

@ -0,0 +1 @@
# Backbone's UMD

@ -1,4 +1,4 @@
{
"copy": "only-title",
"copy": "crash-explain",
"code": "crash"
}

@ -1,4 +1,4 @@
{
"copy": "js-runtime",
"code": "html5"
"code": "prototypes"
}

@ -1,4 +1,3 @@
{
"copy": "js-runtime",
"code": "prototypes"
"copy": "code-share"
}

@ -0,0 +1,4 @@
{
"copy": "umd",
"code": "backbone-umd"
}

@ -0,0 +1,4 @@
{
"copy": "only-title",
"code": "backbone"
}

@ -0,0 +1,4 @@
{
"copy": "testing",
"code": "some-test"
}

@ -0,0 +1,4 @@
{
"copy": "testing",
"code": "test"
}

@ -0,0 +1,3 @@
{
"copy": "other-awesome"
}

@ -0,0 +1,3 @@
{
"copy": "fin"
}
Loading…
Cancel
Save