CTRL + A
: Move the cursor to the beginning of the line
CTRL + E
: Move the cursor to the end of the line
OPTION + Left Arrow
: Move the cursor one word backward
OPTION + Right arrow
: Move the cursor one word forward
Left Arrow
: Move the cursor one character backward
Right Arrow
: Move the cursor one character forward
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
%{IP:client_ip},%{SPACE}%{NOTSPACE:username},%{SPACE}%{DATE_US:date},%{SPACE}%{TIME:time},%{SPACE}%{WORD:service},%{SPACE}%{HOSTNAME:server_name},%{SPACE}%{IP:server_ip},%{SPACE}%{INT:time_taken_ms},%{SPACE}%{INT:client_bytes_sent},%{SPACE}%{INT:server_bytes_sent},%{SPACE}%{INT:http_status_code},%{SPACE}%{INT:windows_status_code},%{SPACE}%{WORD:http_request_verb},%{SPACE}%{URIPATH:http_verb_target},%{SPACE}%{NOTSPACE:http_parameters}, |
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
'''Measure and report the time it takes to simply `import arcpy` | |
Part of https://community.esri.com/message/914048-re-what-is-your-import-arcpy-overhead? | |
''' | |
from timeit import default_timer as timer | |
start = timer() | |
from datetime import datetime, timedelta | |
from uuid import uuid4 | |
eventid = datetime.now().strftime('%Y%m-%d%H-%M%S-') + str(uuid4()) |
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
# Script to export html and csv reports of file and directory content on the system drive | |
# Use to identify large files/directories for disk space cleanup | |
# Uses WizTree portable to quickly retrieve file and directory sizes from the Master File Table on disk | |
# Download and extract the WizTree64.exe and place in the same directory as this script | |
# Set the running location | |
$RunLocation = $PSScriptRoot | |
#$RunLocation = "C:\temp" | |
$TempLocation = "C:\temp" |
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 pandas as pd | |
from geopandas import GeoDataFrame | |
from shapely.geometry import Point | |
import fiona | |
df = pd.read_csv('data.csv') | |
geometry = [Point(xy) for xy in zip(df.x, df.y)] | |
crs = {'init': 'epsg:2263'} #http://www.spatialreference.org/ref/epsg/2263/ | |
geo_df = GeoDataFrame(df, crs=crs, geometry=geometry) |
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 os | |
import yaml | |
import logging.config | |
import logging | |
import coloredlogs | |
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'): | |
""" | |
| **@author:** Prathyush SP | |
| Logging Setup |
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
class Token { | |
[string] $token | |
[System.DateTimeOffset] $expires | |
Token($response) { | |
$this.token = $response.token; | |
$this.expires = [System.DateTimeOffset]::FromUnixTimeMilliseconds($response.expires) | |
} | |
} | |
$rootUri = "https://www.arcgis.com/sharing/rest" |
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 requests | |
import json | |
agol_url = r'http://services1.arcgis.com/uRIm5IkWjDXybgFb/arcgis/rest/services/LA_Nhood_Change/FeatureServer/0/query' | |
server_url = r'http://sampleserver6.arcgisonline.com/arcgis/rest/services/EmergencyFacilities/FeatureServer/0/query' | |
# i tried several different headers, to no avail | |
# headers={"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"} | |
# headers = {"Content-Type": "application/x-www-form-urlencoded", "Accept":"/*/", "Accept-Encoding":"gzip, deflate", "Accept-Language":"en-US,en;q=0.8,ar;q=0.6"} | |
headers={"content-type":"application/json","Accept":"application/json"} |
NewerOlder