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
// this represents with "custom-scripts.js" file located within the "app" directory of appliation files | |
define(["dojo/topic"], function(topic) { | |
/* | |
* Custom Javascript to be executed while the application is initializing goes here | |
*/ | |
// The application is ready | |
topic.subscribe("tpl-ready", function(){ | |
/* | |
* Custom Javascript to be executed when the application is ready goes here |
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
// This is an Esri Arcade expression for labeling features or map pop-ups that combines various road street name component fields into a single value. | |
// It tests for empty values in the record. If the value is empty, it returns an empty string (''). | |
// If the value is not empty, it returns the value of the record. | |
// See https://developers.arcgis.com/arcade/ for more information on Arcade | |
// See https://www.nena.org/page/NG911GISDataModel for more information on NENA NextGen911 data model | |
// Example road: North Main Street | |
// variable to hold the contents of the label for roads | |
var road_label = ""; |
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
# Note: this script is designed to run with Python 3 and ArcGIS Pro ArcPy | |
# import modules | |
# arcpy => provides access to Esri ArcGIS Pro | |
# os => provides convient way to construct file paths | |
# sys => provides way to capture errors | |
# re => used for snake case helper function (taken from https://www.30secondsofcode.org/python/s/snake) | |
import arcpy, os, sys | |
from re import sub |
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
'use strict'; | |
let shuffleArray = array => { | |
let m = array.length, t, i; | |
// While there remain elements to shuffle | |
while (m) { | |
// Pick a remaining element… | |
i = Math.floor(Math.random() * m--); |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Spinner for Wild Kratts Race Around the World Game</title> | |
<meta name="description" content="A simple spinner app for the Wild Kratts Race Around the World board game."> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta property="og:title" content=""> | |
<meta property="og:type" content=""> | |
<meta property="og:url" content=""> |
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
import sys | |
import requests | |
import os | |
from urllib.parse import urlparse | |
from bs4 import BeautifulSoup | |
# page containing links to mp3's of songs from Earthbound | |
music_page_url = 'http://starmen.net/mother2/music/' | |
# container for mp3 links | |
mp3_links = [] |
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
rem turn off console printing | |
@echo off | |
rem set variables for date components (used in log file name) | |
For /f "tokens=2-4 delims=/ " %%a in ("%DATE%") do ( | |
SET YYYY=%%c | |
SET MM=%%a | |
SET DD=%%b | |
) |
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
# see https://developers.arcgis.com/rest/enterprise-administration/portal/export-site.htm | |
# import modules | |
from arcgis.gis import GIS | |
from os import environ | |
from os import path | |
from datetime import date | |
import logging | |
import sys | |
import requests |
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
from arcgis.gis import GIS | |
from arcgis.features import FeatureLayerCollection | |
from print_errors import print_exception # helper module to printing error messages | |
from time import strftime as format_time | |
from time import sleep | |
def optimize(portal_url, username, password, item_id, lyr_idx, req_timeout=180): | |
""" | |
portal_url = URL for GIS portal; string | |
username: username of administrative user to portal; string |
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
# the majority of the script was created by ChatGPT responding to the prompt "is there a python function that can randomly remove records from a CSV file?" | |
import csv | |
import random | |
import sys | |
def remove_records(input_file, output_file, remove_fraction=0.1): | |
""" | |
Randomly removes a fraction of records from a CSV file. | |
OlderNewer