Skip to content

Instantly share code, notes, and snippets.

@andygup
andygup / Retriever
Created September 10, 2013 15:46
Full node http get solution
var http = require("http");
Retrieve = function(){
console.log("retrieve");
/**
* Executes a GET request on the given url and returns a JSON object.
* Default timeout is 20 seconds.
* @param url
@andygup
andygup / NodeBackgroundTimer
Created September 10, 2013 15:54
Node background timer that runs in a child process.
/**
* Timer that runs in a node child process.
* Can be used to control multiple things in the main application.
* @type {*}
*/
var timers = require("timers");
var ___backgroundTimer;
@andygup
andygup / jquery-mbile
Created November 6, 2013 17:06
jQuery mobile + GPS
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
<title>Basic jQuery Mobile Map</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
@andygup
andygup / dragPolyAndroid
Created April 15, 2014 00:51
drag poly android
/* Copyright 2012 ESRI
*
* All rights reserved under the copyright laws of the United States
* and applicable international laws, treaties, and conventions.
*
* You may freely redistribute and use this sample code, with or
* without modification, provided you include the original copyright
* notice and use restrictions.
*
* See the sample code usage restrictions document for further information.
@andygup
andygup / dragPolyAndroid.java
Last active August 29, 2015 13:59
drag poly android
/* Copyright 2012 ESRI
*
* All rights reserved under the copyright laws of the United States
* and applicable international laws, treaties, and conventions.
*
* You may freely redistribute and use this sample code, with or
* without modification, provided you include the original copyright
* notice and use restrictions.
*
* See the sample code usage restrictions document for further information.
@andygup
andygup / index.html
Last active August 29, 2015 13:59
Query by distance
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Select with feature layer</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
@andygup
andygup / esri.ux.layers.ClusterLayer.js
Created April 23, 2014 16:09
An old example js cluster layer with flaring
dojo.require("dojox.lang.functional");
dojo.require("dojox.lang.functional.lambda");
dojo.require("dojox.lang.functional.curry");
dojo.require("dojox.lang.functional.fold");
dojo.declare("esri.ux.layers.ClusterLayer", esri.layers.GraphicsLayer, {
constructor: function (a) {
if (typeof Object.create === "undefined") {
Object.create = function (d) {
function c() {}
c.prototype = d;
@andygup
andygup / clone.js
Last active January 19, 2016 17:32
function for doing a static clone of a JavaScript object. Removes all dependencies from original object.
/**
* Creates a static clone. Removes dependencies between
* clone and original object.
* @param obj
* @return {*}
*/
function clone (obj) {
if(obj == null || typeof(obj) != "object") {
return obj;
@andygup
andygup / appcache-features-edit.html
Created February 1, 2016 23:44
Full offline JS editing widget - (work in progress, NOT final)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0:, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
"use strict";
/*
* Utility library for deleting all features in a feature layer.
* Use this to reset demo feature layers.
* WARNING: this will delete EVERYTHING!
*/
function CleanFeatureLayer(featureLayer, callback)