Skip to content

Instantly share code, notes, and snippets.

Hubbin it up @ Esri

Dave Bouwman dbouwman

Hubbin it up @ Esri
View GitHub Profile
View Bempton-Breeding-Birds.html
<font size='4'>Data created 2010 - 2012.</font>
<font size='4'><br /></font>
<font size='4'><br /></font>
dbouwman /
Last active June 22, 2019 14:51
End to End Test System


Replacement e2e test system that is easy for all devs to debug/extend/maintain.


  • ES6
  • run against local, qa and prod
  • able to run multiple browsers
    • ff/ch/edge
  • report test status to same end-point the ember ones use

Site Boot Flow

Injection Parsing

  • __SITE Injected? Y: use as model, store in appSettings
    • N: __DOMAININFO injected? : Y: use siteId to fetch Site
      • N: use window.location to determine siteId

Determine domainInfo model from Window.location

At this stage we do not actually fetch the full item. We are constructing a hash that is roughly the shape of a domain record:

dbouwman / pen.js
Created February 8, 2019 19:57
CodePen Hacking of /updateInfo
View pen.js
const token = 'FbIWugy4eCsS-hq2ZV42MJR7EYH9ID_AXY2SAeNmCZvi5NVjSNuUysrCr1cgesIZHP_ti31IaGWLZDJFX1U21Z3aQ3B6A8Xcny9kZc-i_IdUzY-kBYXyV2gn_euATqpfr8zw9TemIODV4ORAB0gxDPTwc884PpR_qVwa4Ud-nc47JoN_v53_n1xzSqSX6bg_OSy7VDcevFyiA8hOpWdekg..';
const data = {
name: 'Dave Bouwman',
email: ''
const body = {
file: new Blob([JSON.stringify(data)], {type: 'application/json'}),
f: 'json',
token: token,
dbouwman /
Created August 31, 2017 13:32
Theme Blog Tech

Static Generated Css

For the last year, when a Hub Site was saved, we had been taking your theme colors, and sending them to a server which would generate a complete stylesheet, based on those colors. The resulting css was then stored as a "resource" with the Hub Site item, and would remain static until the site owner edited the theme in the Layout Editor.

In general, this processed worked pretty well, however over time we noticed a number of issues.

The first issue, which caused the most problems, was due to the css being generated and persisted. When Esri updated the underlying application code, all sites would be running that code immediately - however, they would load with the old css. Although we went to great lengths to ensure no catastrophic changes, with tens of thousands of sites, many highly customized, inevitably issues would arise, and customers would have to edit and re-save the site.

The second reason for making a change is that Hub Sites With be included with the ArcGIS Enterprise 10.6 re

View gist:a077bcd28522a1b195629b8f359d7622
* Given a username and password, make a https request for a token
getToken (username, password, portalBaseUrl) {
const url = `${portalBaseUrl}/sharing/rest/generateToken?f=json`;
let options = {
method: 'POST',
form: {
username: username,
password: password,
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
rejectMe () {
return Ember.RSVP.reject('I rejected');
resolveMe () {
return Ember.RSVP.resolve('I resolved');
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
toggleValue() {
inputChanged(value) {
if (typeof this.onchange === 'function') {
dbouwman / panel-card.html
Created September 11, 2016 17:13
Gist w/ Bootstrap Responsive Card
View panel-card.html
<div class="panel panel-default panel-card ">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
<div class="panel-body">
<img src="" class="img-responsive center-block">
<div class="overlay">
<li><span class="glyphicon glyphicon-trash"></span></li>
<li><span class="glyphicon glyphicon-cog"></span></li>
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
attr: {