Skip to content

Instantly share code, notes, and snippets.

View stdavis's full-sized avatar

Scott Davis stdavis

View GitHub Profile
@stdavis
stdavis / create database
Created July 14, 2015 21:52
union statement problems
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Main]') AND type in (N'U'))
DROP TABLE [Main]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Related]') AND type in (N'U'))
DROP TABLE [Related]
GO
CREATE TABLE [Main](
[id] [int] NOT NULL,
USE [UGSWaterChemistry]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DROP TABLE [dbo].[Results]
// #1
array.forEach(criteria, lang.hitch(this, function(crit) {
if (crit && crit.ingredients) {
filter = this._formSqlInQueryFromArray(crit.ingredients);
filters.push( crit.field + ' IN (' + filter + ')');
}
}));
// #2
array.forEach(criteria, function(crit) {
/*global define,location */
/*jslint sloppy:true */
/*
| Copyright 2014 Esri
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
SELECT OBJECTID from Stations WHERE
StationId IN (SELECT StationId from Results WHERE ParamGroup = 'Inorganics, Major, Non-metals') AND
StationId IN (SELECT StationId from Results WHERE ParamGroup = 'Organics, pesticide') AND
StationId IN (SELECT StationId from Results WHERE ParamGroup = 'Physical')
@stdavis
stdavis / gist:2f6e19be55392109388f
Last active August 29, 2015 14:19
is this crazy?
StationId IN (SELECT StationId from Results WHERE ParamGroup = 'Inorganics, Major, Non-metals') AND
StationId IN (SELECT StationId from Results WHERE ParamGroup = 'Organics, pesticide') AND
StationId IN (SELECT StationId from Results WHERE ParamGroup = 'Physical')
@stdavis
stdavis / config.js
Created February 27, 2015 14:18
press options
var config = {
publishServices: {
options: {
// Any service props defined here are applied to all services.
minInstancesPerNode: 1,
maxInstancesPerNode: 3,
// This will also be a place to hold task-specific options.
server: {
username: 'hello',
@stdavis
stdavis / gist:f015503305db3b31590a
Created December 9, 2014 20:34
Update OGM Data
# Update OGM Well and Bottom HoleData
# 7-19-11
# Scott Davis - stdavis@utah.gov
# Bert Granberg - bgranberg@utah.gov
#
# Updated by Scott 6-3-13
import arcpy, os, itertools
from agrc import logging, email, arcpy_helpers
@stdavis
stdavis / .travis.yml
Created November 17, 2014 17:01
.travis.yml
language: node_js
node_js:
- '0.10'
before_install:
- npm install -g grunt-cli
- npm install -g bower
- npm install
- bower install
notifications:
email:
@stdavis
stdavis / gist:c3a52ee95c530cbf3eb5
Last active August 29, 2015 14:05
Basic AMD import statement
require([
// imports go here
], function (
// import parameters go here
) {
// code goes here
function init() {
...
}
});