diff --git a/data/code/crash.js b/data/code/crash.js new file mode 100644 index 0000000..e846217 --- /dev/null +++ b/data/code/crash.js @@ -0,0 +1,8 @@ +function onLoad() { + console.log(this.responseText); +} + +var request = new XMLHttpRequest(); +request.onload = onLoad; +request.open('get', 'http://localhost:8000/', true); +request.send(); diff --git a/data/code/html5.js b/data/code/html5.js new file mode 100644 index 0000000..e4edf4b --- /dev/null +++ b/data/code/html5.js @@ -0,0 +1,19 @@ +var page = require('webpage').create(); +page.viewportSize = {width: 1280, height: 720}; + +page.open('https://html5test.com/', function() { + function doneLoading() { + var el = document.getElementById('loading'); + return window.getComputedStyle(el).display === 'none'; + } + + function checkPage() { + if (page.evaluate(doneLoading)) { + page.render('static/html5.' + phantom.version.major + '.png'); + console.log('created static/html5.' + phantom.version.major + '.png'); + phantom.exit(); + } + setTimeout(checkPage, 100); + } + checkPage(); +}); diff --git a/data/code/phantom-webpage-screenshot.js b/data/code/phantom-webpage-screenshot.js index 2246a33..dc4afc7 100644 --- a/data/code/phantom-webpage-screenshot.js +++ b/data/code/phantom-webpage-screenshot.js @@ -1,10 +1,9 @@ -var webpage = require('webpage'); -var page = webpage.create(); +var page = require('webpage').create(); page.viewportSize = {width: 1280, height: 720}; page.open('http://phantomjs.org', function() { page.render('phantomjs.png'); - console.log('created phantomjs.png'); + console.log('created phantomjs.png. ☮ out!'); phantom.exit(); }); diff --git a/data/code/use-after-free.js b/data/code/use-after-free.js new file mode 100644 index 0000000..679d261 --- /dev/null +++ b/data/code/use-after-free.js @@ -0,0 +1,10 @@ +(function (phantom) { + var foo = {bar: {baz: 123}}; + delete foo.bar; + try { + console.log(foo.bar.baz); + } catch (err) { + console.log(err); + phantom && phantom.exit(); + } +}(this.phantom)); diff --git a/data/copy/about.md b/data/copy/about.md index 4ca678c..bbb17d4 100644 --- a/data/copy/about.md +++ b/data/copy/about.md @@ -1,7 +1,5 @@ # About Me - Hi, I'm Buddy ☺ - - Not affiliated with PhantomJS in any way - Principal Software Engineer at Convertro/AOL (we're hiring) - Full Stack engineer (JavaScript, Go, Python, etc) - - Like motorcycles, math, science and obnoxious 80's punk diff --git a/data/copy/define-developer.md b/data/copy/define-developer.md deleted file mode 100644 index d40a1c3..0000000 --- a/data/copy/define-developer.md +++ /dev/null @@ -1,3 +0,0 @@ -# Developer Definition: - -## PhantomJS is a **JavaScript runtime** that gives access to native **Qt/WebKit** objects. diff --git a/data/copy/define-simple.md b/data/copy/define-simple.md deleted file mode 100644 index 008290a..0000000 --- a/data/copy/define-simple.md +++ /dev/null @@ -1,3 +0,0 @@ -# Simple Definition: - -## Headless Web Browser diff --git a/data/copy/define.md b/data/copy/define.md deleted file mode 100644 index ec9dd77..0000000 --- a/data/copy/define.md +++ /dev/null @@ -1,5 +0,0 @@ -# Define - -PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast -and native support for various web standards: DOM handling, CSS selector, -JSON, Canvas, and SVG. diff --git a/data/copy/not-node.md b/data/copy/not-node.md new file mode 100644 index 0000000..b4906b2 --- /dev/null +++ b/data/copy/not-node.md @@ -0,0 +1,6 @@ +# PhantomJS is not Node.js + +## **PhantomJS** is a JavaScript runtime based on **Qt** and **WebKit**. + + +## **Node.js** is a JavaScript runtime based on **V8** and **libuv**. diff --git a/data/copy/null-pointer.md b/data/copy/null-pointer.md new file mode 100644 index 0000000..4941e60 --- /dev/null +++ b/data/copy/null-pointer.md @@ -0,0 +1,17 @@ +# This will just crash + +```bash +$ gcc -xc - < +int main() { + int *p = NULL; + printf("Before pointer dereference\n"); + *p = 1; + printf("After pointer dereference\n"); + return 0; +} +APP +$ ./a.out +Before pointer dereference +Segmentation fault (core dumped) +``` diff --git a/data/copy/qt.md b/data/copy/qt.md new file mode 100644 index 0000000..50ec6a4 --- /dev/null +++ b/data/copy/qt.md @@ -0,0 +1,5 @@ +# Qt + +> ## "Qt is a cross-platform application and UI framework" + +## [http://qt-project.org/](http://qt-project.org/) diff --git a/data/copy/title.md b/data/copy/title.md index f349254..ea8c021 100644 --- a/data/copy/title.md +++ b/data/copy/title.md @@ -5,3 +5,5 @@ - [github.com/xbudex/phantom-talk](https://github.com/xbudex/phantom-talk) - buddy.sandidge@gmail.com + + - February 26, 2015 diff --git a/data/copy/use-after-free.md b/data/copy/use-after-free.md new file mode 100644 index 0000000..2afb56e --- /dev/null +++ b/data/copy/use-after-free.md @@ -0,0 +1 @@ +# This will error, not crash diff --git a/data/slide/05.json b/data/slide/05.json index 9302e07..9496681 100644 --- a/data/slide/05.json +++ b/data/slide/05.json @@ -1,3 +1,3 @@ { - "copy": "define-developer" + "copy": "not-node" } diff --git a/data/slide/06.json b/data/slide/06.json index 468ceb8..6d4cd4c 100644 --- a/data/slide/06.json +++ b/data/slide/06.json @@ -1,4 +1,3 @@ { - "copy": "js-runtime", - "code": "prototypes" + "copy": "qt" } diff --git a/data/slide/07.json b/data/slide/07.json new file mode 100644 index 0000000..6ecc732 --- /dev/null +++ b/data/slide/07.json @@ -0,0 +1,4 @@ +{ + "copy": "use-after-free", + "code": "use-after-free" +} diff --git a/data/slide/08.json b/data/slide/08.json new file mode 100644 index 0000000..0d1a9e5 --- /dev/null +++ b/data/slide/08.json @@ -0,0 +1,3 @@ +{ + "copy": "null-pointer" +} diff --git a/data/slide/09.json b/data/slide/09.json new file mode 100644 index 0000000..c05568a --- /dev/null +++ b/data/slide/09.json @@ -0,0 +1,4 @@ +{ + "copy": "only-title", + "code": "crash" +} diff --git a/data/slide/10.json b/data/slide/10.json new file mode 100644 index 0000000..2d06af8 --- /dev/null +++ b/data/slide/10.json @@ -0,0 +1,4 @@ +{ + "copy": "js-runtime", + "code": "html5" +} diff --git a/data/slide/11.json b/data/slide/11.json new file mode 100644 index 0000000..468ceb8 --- /dev/null +++ b/data/slide/11.json @@ -0,0 +1,4 @@ +{ + "copy": "js-runtime", + "code": "prototypes" +}