1,311 Matching Annotations
  1. Oct 2018
    1. Components.js is a dependency injection framework for JavaScript applications. Instead of hard-wiring software components together, Components.js allows these components to be instantiated and wired together declaratively using semantic configuration files. The advantage of these semantic configuration files is that software components can be uniquely and globally identified using URIs. Configurations can be written in any RDF serialization, such as JSON-LD. This software is aimed for developers who want to build modular and easily configurable and rewireable JavaScript applications.
    1. A tool for visualizing Execution Context, Hoisting, Closures, and Scopes in JavaScript
    1. <html> <body style='background-color:black'> <canvas id="myCanvas" width="800" height="340"></canvas> <script> let canvas = document.getElementById('myCanvas'); let context = canvas.getContext('2d'); context.lineWidth = 5; context.strokeStyle = 'gray' context.beginPath(); for(let x=0;x<28;x++){         context.moveTo(x*40-304,0);         context.lineTo(x*40+20,340);         context.moveTo(x*40,0);         context.lineTo(x*40-324,340);         } context.stroke();   context.fillStyle = 'white'; for(let x=0;x<20;x++)         for(let y=0;y<9;y++){                 context.beginPath();                 context.arc(8+x*40, y*42-9, 3, 0, 2 * Math.PI);                 context.arc(28+x*40, y*42-29, 3, 0, 2 * Math.PI);                 context.fill();                                         } </script> </body> </html>
  2. heycam.github.io heycam.github.io
    1. This document defines an interface definition language, Web IDL, that can be used to describe interfaces that are intended to be implemented in web browsers. Web IDL is an IDL variant with a number of features that allow the behavior of common script objects in the web platform to be specified more readily.
    1. Before we begin, it’s important to understand that the ES6 tail call optimization is an optimization implemented by the interpreter. ES6 does not specify new syntax for denoting tail call optimization
    1. The ReadableStream interface of the Streams API represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
  3. Sep 2018
    1. Douglas Crockford 2018-08-24 JSCheck is a testing tool for JavaScript. It was inspired by QuickCheck, a testing tool for Haskell developed by Koen Claessen and John Hughes of Chalmers University of Technology. JSCheck is a specification-driven testing tool. From a description of the properties of a system, function, or object, it will generate random test cases attempting to disprove those properties, and then report its findings. That can be especially effective in managing the evolution of a program because it can show the conformance of new code to old code. It also provides an interesting level of self-documentation, because the executable specifications it relies on can provide a good view of the workings of a program.
    1. Nightwatch.js is an easy to use Node.js based End-to-End (E2E) testing solution for browser based apps and websites. It uses the powerful W3C WebDriver API to perform commands and assertions on DOM elements.
    1. Let’s think of some properties for the rectangle area function: Given any two width and height values, the result is always a multiple of the two Order doesn’t matter. A rectangle which is 50×100 has the same area as one which is 100×50 If we divide the area by width, we should get the height Here we have three examples of how we can verify the test result for any given input without having to know the inputs up front. All of these should always hold true for any given valid input.
    1. JSVerify is a property-based testing library, highly inspired by QuickCheck. It is testing framework agnostic, you could use JSVerify with Mocha, nodeunit, Jasmine or any other framework.
    1. const sq = require('sqorn-pg')() const kid = sq.from`person`.where`age < 13`

      function hello(name) { console.log(How are you ${name}); }

      // The convention is to write the string right // after the function name... helloMichele //-> How are you Michele

      //...but you can put a space too hello Michele //-> How are you Michele

    1. var el; var i = 0; var fragment = document.createDocumentFragment(); while (i < 200) { el = document.createElement('li'); el.innerText = 'This is my list item number ' + i; fragment.appendChild(el); i++; } div.appendChild(fragment);
    1. The fastest (): while (node.lastChild) { node.removeChild(node.lastChild); } Alternatives (slower): while (node.firstChild) { node.removeChild(node.firstChild); } while (node.hasChildNodes()) { node.removeChild(node.lastChild); }
    1. let root = document.documentElement; root.addEventListener("mousemove", e => { root.style.setProperty('--mouse-x', e.clientX + "px"); root.style.setProperty('--mouse-y', e.clientY + "px"); });
  4. Jun 2018
  5. Sep 2017
  6. May 2017
    1. "who's the target of the assignment (LHS)" and "who's the source of the assignment (RHS)".

      LHS is looking for the target of that assignment whiel RHS is looking for the source!

  7. Jan 2017
    1. var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); // ... give time for script to load, then type (or see below for non wait option) jQuery.noConflict();

      Add jQuery in the console!

  8. Jul 2016
  9. developers.google.com developers.google.com
    1. origin: new google.maps.Point(0, 0),

      like if you want a sprite you would specify a different origin

    1. $

      alias for literally, "jQuery"

    2. #

      go get w/e element has a unique id of "symbol"

    3. return false;"

      we return false because by default we submit to the same webpage, and if we submit to the page then the page reloads-- not what we're looking for here

    4. <form onsubmit="quote(); return false;">

      is an event handler

      IT handles the event of a submission. :)

  10. Nov 2015
  11. Oct 2015
  12. Sep 2015
    1. Should you wish to learn more about the language, I am happy to recommend the following titles: JavaScript: The Definitive Guide by David Flanagan Eloquent JavaScript by Marijn Haverbeke JavaScript Patterns by Stoyan Stefanov Writing Maintainable JavaScript by Nicholas Zakas JavaScript: The Good Parts by Douglas Crockford
  13. Jul 2015
    1. D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.

      cool

    Tags

    Annotators

    URL

    1. Netflix JavaScript Talks - Async JavaScript with Reactive Extensions

      "Design Patterns, Elements of Reusable Object-Oriented Software"

      Iterator Pattern

      Pulling data, one by one.

      Observer Pattern

      See Pub-Sub, Event-Emitter. Give a callback to a data producer.

  14. Jun 2015
    1. Note: I'm unconvinced of Promise.race's usefulness; I'd rather have an opposite of Promise.all that only rejects if all items reject.

      This is hurting my brain. Can we just use a meta-promise that fulfills when rejected, and reject when fulfilled in order to achieve that?

  15. May 2015
    1. WebODF is a JavaScript library that makes it easy to add Open Document Format (ODF) support to your website and to your mobile or desktop application. It uses HTML and CSS to display ODF documents.