This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import string | |
import sys | |
def caesar(value): | |
for i in range(0, 26): | |
#print(value.translate(str.maketrans(myAlphabet, myAlphabet[i:] + myAlphabet[:i]))) | |
print(value.translate(str.maketrans(string.ascii_letters, string.ascii_lowercase[i:] + string.ascii_lowercase[:i] + string.ascii_uppercase[i:] + string.ascii_uppercase[:i]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["esri/arcgis/utils"], function (arcgisUtils) { | |
//... | |
// functionality to fix dates | |
var oneDay = 24 * 60 * 60 * 1000; | |
function timeFix(value) { | |
var dateShift, val; | |
if (value === undefined || value === null) { | |
return value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["esri/map", "esri/layers/FeatureLayer", "esri/tasks/query"], function (map, FeatureLayer, query) { | |
var features = [/* assume a list of feature graphics will be assigned here soon */]; | |
// do stuff to assign maps, feature layers, etc. | |
// do stuff to assign features as a list of search results from a feature layer | |
var importantDates = features.map(function (feature) { | |
if (feature.attributes["ImportantDate"] !== null) { | |
return new Date(feature.attributes["ImportantDate"]); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
"dojo/_base/declare", | |
"dojo/_base/array", | |
"dojo/query", | |
"put-selector/put", | |
"esri/dijit/LayerList" | |
], function (declare, arrayUtils, dojoQuery, put, LayerList) { | |
return declare([LayerList], { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
jshint: { | |
files: ['Gruntfile.js', 'src/**/*.js'], | |
options: { | |
browser: true, | |
'-W083': true, // don't form functions within loops (hard when calling Array.prototype.forEach inside another Array.prototype.forEach) | |
scripturl: true, // no script URL (I sometimes use javascript:void(0); instead of # when I have routes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
"dojo/_base/array", | |
"esri/geometry/Polygon", | |
"esri/geometry/Polyline", | |
"esri/geometry/Point", | |
"esri/geometry/geometryEngine" | |
], function (arrayUtils, Polygon, Polyline, Point, geometryEngine) { | |
/** | |
* Finds a point on a polyline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A dojo plugin that extracts possible query parameters from the URL. | |
* @module search/UrlSearch | |
*/ | |
define(["esri/urlUtils"], function (urlUtils) { | |
// regex for parameter names to ignore | |
var ignoreParameters = [ | |
/^appid$/i, // ArcGIS Online uses appid parameter to define application id | |
/^folderid$/i, // ArcGIS Online uses folderid to define folder hash where webmap is stored | |
/^webmap$/i // ArcGIS Online uses webmap property to define the map to use in the application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An update on David Walsh's Unique Combobox | |
* Updated for Dojo AMD (tested at v. 1.10) | |
* Originally posted: https://davidwalsh.name/unique-combobox | |
*/ | |
define("davidwalsh.form._UniqueComboBoxMenu", | |
["dojo/_base/declare", "dojo/_base/array", "dijit/form/_ComboBoxMenu"], | |
function (declare, arrayUtils, _ComboBoxMenu) { | |
return declare([_ComboBoxMenu], { | |
createOptions: function (results, dataObject, labelFunc) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets a time stamp out of either localStorage, or a cookie session, if those are available. | |
* Use in conjunction with SetTimeStamp module. | |
* @module GetTimeStamp | |
* @param {string} id - string id you want to use to retrieve a time stamp from the browser | |
* @returns {Date} - Date of the last time stamp | |
*/ | |
define(["dojo/cookie"], function (cookie) { | |
return { | |
load: function (id, require, callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> | |
<title>Simple Map</title> | |
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css"> | |
<style> | |
html, body, #map { | |
height: 100%; |