Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Rockin' the dad jeans

Tom Wayson tomwayson

💭
Rockin' the dad jeans
View GitHub Profile
@ryoppy
ryoppy / getQueryParams.js
Last active Mar 28, 2019
Parse query string. use Underscore.js.
View getQueryParams.js
/**
* Parse query string.
* ?a=b&c=d to {a: b, c: d}
* @param {String} (option) queryString
* @return {Object} query params
*/
getQueryParams: function(queryString) {
var query = (queryString || window.location.search).substring(1); // delete ?
if (!query) {
return false;
View classes-vs-functions.md

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.

@jwasilgeo
jwasilgeo / angular2-esri-loader instructions.md
Last active Nov 2, 2017
angular2-esri-loader instructions
View angular2-esri-loader instructions.md
@odoe
odoe / gulpfile.js
Created Feb 11, 2016
Sample gulpfile for Dojo builds
View gulpfile.js
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());
});
@dbouwman
dbouwman / gist:aa129684b267eaa5557c30511c6f9835
Last active Jun 30, 2016
Open Data Front-End Plans July 2016
View gist:aa129684b267eaa5557c30511c6f9835

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.
View async.js
/*global dojoConfig */
define(function() {
var cb = '_asyncApiLoaderCallback';
return {
load: function(param, req, loadCallback) {
if (!cb) {
return;
} else {
dojoConfig[cb] = function() {
delete dojoConfig[cb];
@fatso83
fatso83 / gist:88370e1d75de2b9ba00b
Created Mar 9, 2015
Gulp config for babelify
View gist:88370e1d75de2b9ba00b
var gulp = require('gulp');
var source = require('vinyl-source-stream'); // Used to stream bundle for further handling
var browserify = require('browserify');
var watchify = require('watchify');
var gulpif = require('gulp-if');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');
var notify = require('gulp-notify');
var concat = require('gulp-concat');
var cssmin = require('gulp-cssmin');
@thollingshead
thollingshead / Commented_Dojo_Widget.sublime-snippet
Created Feb 4, 2016
Sublime snippet for Dojo widget boilerplate, with commented out lifecycle methods.
View Commented_Dojo_Widget.sublime-snippet
<snippet>
<content><![CDATA[
define([
'dijit/_WidgetBase',
'dojo/_base/declare'
], function(
_WidgetBase,
declare
) {
@thollingshead
thollingshead / Dojo_Templated_Widget.sublime-snippet
Created Feb 4, 2016
Sublime snippet for Dojo templated widget boilerplate
View Dojo_Templated_Widget.sublime-snippet
<snippet>
<content><![CDATA[
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
${2:
'dojo/i18n!./$1/nls/resources',}
'dojo/text!./$1/templates/$1.html'${5:,
@thollingshead
thollingshead / Dojo_Module.sublime-snippet
Created Feb 4, 2016
Sublime snippet for Dojo module boilerplate.
View Dojo_Module.sublime-snippet
<snippet>
<content><![CDATA[
define([
${1:'dojo/_base/declare'}
], function(
${2:declare}
) {
return declare([$3], {
$4
});