Skip to content

Instantly share code, notes, and snippets.

View stdavis's full-sized avatar

Scott Davis stdavis

View GitHub Profile
@stdavis
stdavis / gist:3829174
Created October 3, 2012 19:20
Add symbolic link to applications folder for iOS emulator
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app
@stdavis
stdavis / gist:3843338
Created October 6, 2012 01:11
.jshintrc template
{
"predef": [
"dojo",
// jquery
"$",
// Leaflet
"L",
// AMD
{
"displayFieldName": "",
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 26912,
"latestWkid": 26912
},
"fields": [{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
define([
'dojo/_base/declare',
'dojo/_base/Deferred',
'cem/Helpers',
'dojo/cookie',
'dojo/json'
],
function (declare, Deferred, helpers, cookie, json) {
return declare('cem.Authentication', null, {
@stdavis
stdavis / gist:3903691
Created October 17, 2012 04:23
GetLakePackagesForPurchase Option 1 (preferred)
{
"products": [
{
"name": "Michigan",
"packages": [
{
"name": "Lake Michigan",
"packageId": 123
},
{
@stdavis
stdavis / gist:3903703
Created October 17, 2012 04:27
GetLakePackagesForPurchase Option 2 (not preferred)
{
"packages": [
{
"name": "Lake Michigan",
"packageId": 123,
"product": "Michigan"
},
{
"name": "Lake Michigan",
"packageId": 123,
@stdavis
stdavis / gist:3915515
Created October 19, 2012 00:08
Mock Dojo AMD Dependencies Using Jasmine
var dojoConfig = {
has: {'dojo-undef-api': true}
};
function stubModule(modulePath, stubs, forcedRefreshModules) {
// inspired by: http://stackoverflow.com/questions/11439540/how-can-i-mock-dependencies-for-unit-testing-in-requirejs
// and https://github.com/mattfysh/testr.js
var aliases = [],
key,
stubname,
returnModule,
@stdavis
stdavis / gist:4269226
Created December 12, 2012 16:23
AGRC Geocoder Snippet
// dojoScript is dojo/io/script (dojo 1.7)
var params = {
url: "//mapserv.utah.gov/wsut/Geocode.svc/hello/street(" + this.milepostTxt.value +
")zone(" + this.routeTxt.value + ")",
handleAs: 'json',
timeout: this.timeout,
preventCache: true,
callbackParamName: 'callback'
};
var that = this;
@stdavis
stdavis / gist:4746644
Created February 9, 2013 19:17
iOS Device Media Queries
/* iPhone (3.5") portrait */
@media only screen and (device-height: 480px) and (orientation: portrait) {
}
/* iPhone (3.5") landscape */
@media only screen and (device-height: 480px) and (orientation: landscape) {
}
/* iPhone retina (3.5") portrait */
@media only screen and (device-height: 480px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {
@stdavis
stdavis / gist:5033180
Last active December 14, 2015 05:09
SolarSOEComparison for State Office Building
// old service
{
"SolarValues": {
"directDur": [116, 133, 194, 232, 281, 274, 278, 252, 198, 168, 118, 89],
"directRad": [47362, 55685, 85571, 111281, 134067, 118954, 110845, 93663, 59411, 41572, 34990, 34176],
"durArea": 2765,
"time": "18.0028616"
}
}