diff --git a/slides/javascript-ex1.md b/slides/javascript-ex1.md new file mode 100644 index 0000000000000000000000000000000000000000..92f60f605a1cf2400a2dd936fc05cb1f2add327f --- /dev/null +++ b/slides/javascript-ex1.md @@ -0,0 +1,15 @@ +## Javascript example #1 + +Some simple DOM manipulation + +```javascript +// Grab every div on the page +var divs = document.querySelectorAll("div"); + +// Loop through each element +for (var i = 0; i < divs.length; i++) { + // Change the background image + divs[i].style.backgroundImage = + "url('http://stfn.me/stefchat/stefchatweb.jpg')"; +} +``` \ No newline at end of file diff --git a/slides/javascript-ex2.md b/slides/javascript-ex2.md new file mode 100644 index 0000000000000000000000000000000000000000..642433815745a558b597675c6a778dbd5c04a67a --- /dev/null +++ b/slides/javascript-ex2.md @@ -0,0 +1,28 @@ +## Javascript Example #2 + +First class functions!! + +```javascript +function englishHello(name) { + console.log("Hello " + name); +} + +function swedishHello(name) { + console.log("Hej " + name); +} + +var cse333 = swedishHello; + +function helloCaller(name, helloFunction) { + helloFunction(name); +} + +helloCaller("Brendan Eich", englishHello); +helloCaller("Grace Hopper", swedishHello); +helloCaller("Abraham Lincoln", cse333); +``` + +<pre> +Hello Brendan Eich +Hej Grace Hopper +Hej Abraham Lincoln</pre> diff --git a/slides/javascript-to-the-rescue.md b/slides/javascript-to-the-rescue.md new file mode 100644 index 0000000000000000000000000000000000000000..0e78619f38e0bcb4d19920d7ccb2c2de258a484e --- /dev/null +++ b/slides/javascript-to-the-rescue.md @@ -0,0 +1,8 @@ +## Javascript to the rescue + +* Designed in 10 days by Brendan Eich + * @see <a href="https://www.destroyallsoftware.com/talks/wat">Wat by Gary Bernhardt</a> +* Dynamic typing +* First class functions +* **Event loop** +* **Non-blocking I/O** diff --git a/slides/jsexample.js b/slides/jsexample.js new file mode 100644 index 0000000000000000000000000000000000000000..e46b0910879fe47403af9621a8bbe7e1a2477038 --- /dev/null +++ b/slides/jsexample.js @@ -0,0 +1,25 @@ +// Grab every div on the page +var divs = document.querySelectorAll("div"); + +// Loop through each element +for (var i = 0; i < divs.length; i++) { + + // Change the background image + divs[i].style.backgroundImage = "url('http://stfn.me/stefchat/stefchatweb.jpg')"; +} + + +function englishHello(name) { + console.log("Hello " + name); +} + +function swedishHello(name) { + console.log("Hej " + name); +} + +function helloCaller(name, helloFunction) { + helloFunction(name); +} + +helloCaller("Brendan Eich", englishHello); +helloCaller("Grace Hopper", swedishHello); \ No newline at end of file diff --git a/slides/list.json b/slides/list.json index 3eb3d0bfda13c90cd91beea50169a269839b5b65..39f423df2554360f8ac6a1135af44e8a550e77f3 100644 --- a/slides/list.json +++ b/slides/list.json @@ -1,5 +1,10 @@ [ "nodejs.md", "who-is-this-kid.md", - "outline.md" + "outline.md", + "what-even-is-node.md", + "problem-background.md", + "javascript-to-the-rescue.md", + "javascript-ex1.md", + "javascript-ex2.md" ] \ No newline at end of file diff --git a/slides/problem-background.md b/slides/problem-background.md new file mode 100644 index 0000000000000000000000000000000000000000..968f74bf1152fca1a1d3f567ed1b060c1f30d88f --- /dev/null +++ b/slides/problem-background.md @@ -0,0 +1,7 @@ +## The Problem + +* Single thread synchronous I/O + * Cool! Totally works and easy to think about +* Multithread synchronous I/O + * OH NOES +* Scaling, concurrency, etc \ No newline at end of file diff --git a/slides/what-even-is-node.md b/slides/what-even-is-node.md new file mode 100644 index 0000000000000000000000000000000000000000..64c41be6acebfd4776b69eaf3ddf35a841ddb834 --- /dev/null +++ b/slides/what-even-is-node.md @@ -0,0 +1 @@ +## What even *is* node?