Skip to content

Instantly share code, notes, and snippets.

{{#if objectsPromise.isPending}}
<p>Loading...</p>
{{/if}}
{{#if objectsPromise.isResolved}}
{{#each objects}}
{{#each .}}
{{#if renderField(%key)}}
<td>{{formatValue(.)}}</td>
{{/if}}
{{/each}}
@green3g
green3g / File structure
Last active March 23, 2016 17:37
Steal export problems
Project structure
-----------------
/
app/
app_files...
components/
component1/
component1.js
component1.stache
mapOptions: {
basemap: "topo",
extent: new m({
xmin: -1.038891959E7,
ymin: 5505576.68,
xmax: -1.037829484E7,
ymax: 5517328.87,
spatialReference: {
wkid: 102100
}
10005 silly mapToRegistry uri https://registry.npmjs.org/options
10006 silly fetchNamedPackageData ultron
10007 silly mapToRegistry name ultron
10008 silly mapToRegistry using default registry
10009 silly mapToRegistry registry https://registry.npmjs.org/
10010 silly mapToRegistry uri https://registry.npmjs.org/ultron
10011 silly fetchNamedPackageData bufferutil
10012 silly mapToRegistry name bufferutil
10013 silly mapToRegistry using default registry
10014 silly mapToRegistry registry https://registry.npmjs.org/
Edit Log Started at: 6/28/2016 8:06:00 AM
-----------------------------------------
Process Count: 0
Unwiring the events
#######################################################
storm_struc - ON_CREATE
Starting AA
***********************************************************
############ 6/28/2016 8:06:06 AM ################
@green3g
green3g / ModuleA.js
Created July 21, 2016 13:34
Circular dependency
import can from 'can';
import {B} from './ModuleB';
export let A = {
a: 1
};
export let ExtendedA = can.extend({}, A, {
a2: B
});
@green3g
green3g / dojo.js
Last active February 19, 2017 12:08
SystemJS Dojo Loader
exports = {
fetch: function(load, fetch) {
console.log('load', load);
let module = load.name.split('!')[0];
return new Promise(function(resolve) {
//use dojo's require and then register the module
window.require([module], function(mod) {
System.register(module, [], function(exp, idObj) {
var result = {
setters: [],
@green3g
green3g / search.js
Created October 11, 2016 13:15
A pretty interesting example of adding custom buttons to tmcgee's search widget
define([
'dojo/_base/lang',
'dojo/topic',
'tmcgee/Search',
'dijit/form/Button',
'./auth_util'
], function (lang, topic, Search, Button, Auth) {
var workorderButton = {
include: Auth.hasOneRole(['workorders_create', 'admin']),
define([
'dijit/form/Button',
'dojo/dom',
'dojo/i18n!./nls/main'
], function(Button, dom, i18n) {
var updateFeature = function(data) {
// get the feature layer
@green3g
green3g / hybrid.py
Created November 4, 2016 17:08
flask restless hybrid filtering
import flask
import flask_sqlalchemy
import flask_restless
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy import event, select, func
from sqlalchemy.sql.expression import case
# Create the Flask application and the Flask-SQLAlchemy object.
app = flask.Flask(__name__)
app.config['DEBUG'] = True