You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
💭
Rockin' the dad jeans
Tom Wayson
tomwayson
💭
Rockin' the dad jeans
JavaScript engineer building mapping applications using the ArcGIS Platform and JavaScript frameworks like React and Ember
This is a ServiceWorker template to turn small github pages into offline ready app.
Why ?
Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.
Notes
Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.
ArcGIS JSAPI setup build with Webpack for production (start reading from webpack.config.js)
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
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
Sublime snippet for Dojo widget boilerplate, with commented out lifecycle methods.
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
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
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
Sublime snippet for Dojo templated widget boilerplate
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
How are classes different from traditional functions?
ES6 introduced a new protocol for constructing instances, but its features (incl. new.target) work in both classes and traditional functions. These are the differences between traditional functions and classes:
Traditional functions can’t make superconstructor calls via super(). That means that they are always base classes. In ES5, superconstructors are called as functions.
The prototype of traditional functions and base classes is Function.prototype. The prototype of a derived class is its superclass.
Classes can’t be function-called. An exception is thrown if you do.