Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tomwayson's full-sized avatar
💭
Rockin' the dad jeans

Tom Wayson tomwayson

💭
Rockin' the dad jeans
View GitHub Profile
@jwasilgeo
jwasilgeo / angular2-esri-loader instructions.md
Last active November 2, 2017 15:46
angular2-esri-loader instructions
@dbouwman
dbouwman / gist:aa129684b267eaa5557c30511c6f9835
Last active June 30, 2016 14:09
Open Data Front-End Plans July 2016

Open Data Front-End Strategy

July 2016

Sites / Layout Issues

  • lets put this on hold for a sprint
  • get feedback and tackle UX issues systematically vs rushing and guessing

Layout Issues

  • the current system for isolating the Layout Editor from the Layout CSS is not working correctly and needs to be re-assessed
  • Footers! Footers need to be "extracted" so they can be rendered on any page, not just the Home page of a site.
@kosamari
kosamari / _ServiceWorker_for_github_pages.md
Last active April 1, 2024 05:44
ServiceWorker for github pages.

ServiceWorker for github pages

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.

@gund
gund / index.html
Last active February 12, 2024 00:06
ArcGIS JSAPI setup build with Webpack for production (start reading from webpack.config.js)
<!DOCTYPE html>
<html>
<head>...</head>
<body>
<!-- Load Esri lib -->
<link rel="stylesheet" href="//js.arcgis.com/4.0/esri/css/main.css">
<script src="//js.arcgis.com/4.0/"></script>
<!-- Load our AMD app -->
<script type="text/javascript">
// Wrap our app startup in AMD module
@odoe
odoe / gulpfile.js
Created February 11, 2016 19:04
Sample gulpfile for Dojo builds
var gulp = require('gulp');
var clean = require('gulp-clean');
var rename = require("gulp-rename");
var spawn = require('child_process').spawn;
gulp.task('clean-dist', function () {
return gulp.src('dist/', { read: false })
.pipe(clean());
});
@thollingshead
thollingshead / Commented_Dojo_Widget.sublime-snippet
Created February 4, 2016 21:06
Sublime snippet for Dojo widget boilerplate, with commented out lifecycle methods.
<snippet>
<content><![CDATA[
define([
'dijit/_WidgetBase',
'dojo/_base/declare'
], function(
_WidgetBase,
declare
) {
@thollingshead
thollingshead / Dojo_Module.sublime-snippet
Created February 4, 2016 19:11
Sublime snippet for Dojo module boilerplate.
<snippet>
<content><![CDATA[
define([
${1:'dojo/_base/declare'}
], function(
${2:declare}
) {
return declare([$3], {
$4
});
@thollingshead
thollingshead / Dojo_Widget.sublime-snippet
Last active February 4, 2016 20:35
Sublime snippet for Dojo widget boilerplate.
<snippet>
<content><![CDATA[
define([
'dijit/_WidgetBase',
'dojo/_base/declare'
], function(
_WidgetBase,
declare
) {
@thollingshead
thollingshead / Dojo_Templated_Widget.sublime-snippet
Created February 4, 2016 19:07
Sublime snippet for Dojo templated widget boilerplate
<snippet>
<content><![CDATA[
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
${2:
'dojo/i18n!./$1/nls/resources',}
'dojo/text!./$1/templates/$1.html'${5:,

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.