Skip to content

Instantly share code, notes, and snippets.

View dersteppenwolf's full-sized avatar
🏠
Working from home

Juan Carlos Méndez dersteppenwolf

🏠
Working from home
View GitHub Profile
import arcpy
import os
#"unregistering as versioned" multiple datasets using arcpy
try:
conn_path = "c:/temp/RUTACONN.SDE"
datasets = ["DATASET_01", "DATASET_02", "DATASET_03", "DATASET_04", "DATASET_05"]
for dataset in datasets:
dataset_path = os.path.join(conn_path,dataset )
print dataset_path
datasetVersioned = arcpy.Describe(dataset_path).isVersioned
@dersteppenwolf
dersteppenwolf / gist:f1b5965387234e109061
Created November 12, 2015 14:53 — forked from cwalv/gist:9191377
gpServiceDeploy.py
#!/usr/bin/env python
'''
This script creates an .sd from a .pyt
.. It assumes that all tools can be called with no parameters (i.e.,
all parameters are "optional". Not ideal for all services, but
works fine for services that arn't called from ArcMap anyway.
If you are calling your service from ArcMap, publish the traditional
way ..
@dersteppenwolf
dersteppenwolf / GeodatabaseToCartoDB.py
Last active January 18, 2016 22:03
Export data from Arcgis Desktop to CartoDB using Python / Arcpy
# -*- coding: utf-8 -*-
# Requires CartoDB Toolbox for Arcgis http://gkudos.com/blog/2015/05/15/cartodb-toolbox/
# http://stackoverflow.com/questions/29134512/insecureplatformwarning-a-true-sslcontext-object-is-not-available-this-prevent
# python -m pip install requests[security]
# Import arcpy module
import arcpy
import logging, os
from arcpy import env
@dersteppenwolf
dersteppenwolf / README.md
Created March 31, 2016 23:29 — forked from rochoa/README.md
CartoDB's MVT service + Mapbox GL

CartoDB's MVT service + Mapbox GL

Check index.html for some examples. These use a beta feature of CartoDB's Maps API: fixed URLs. So there is no need to use cartodb.js and tiles can be consumed using a named map name.

cartodb.js example

Check cartodb.js.html to see the integration with cartodb.js and in particular with cartodb.core.js.

Mapbox GL resources

@dersteppenwolf
dersteppenwolf / Killing_Godzillas_using_Arcpy.py
Last active August 27, 2016 12:18
Killing Godzillas using Arcpy
try:
max_num_vertex = 250
feature = "yourFeatureName"
dataset = "yourDatasetName"
sourceWorkspace= "C:/data/gdb/yourdata.gdb"
env.workspace = sourceWorkspace + '/' + dataset + '/'
layerSelection = "selectedLayer"
arcpy.MakeFeatureLayer_management(feature, layerSelection)
result = arcpy.GetCount_management(layerSelection)
resultValue = result.getOutput(0)
@dersteppenwolf
dersteppenwolf / README.md
Created March 11, 2017 13:44 — forked from ramiroaznar/README.md
ramiroaznar meta gist

Meta Gist

  • PostgreSQL and PostGIS queries
  • CartoCSS styles
  • CARTO.js blocks
  • DI.js blocks
  • Leaflet.js blocks
  • Other blocks
  • Others
@dersteppenwolf
dersteppenwolf / docker-compose
Created April 7, 2017 10:24 — forked from yarikc/docker-compose
docker-compose for Elastic 5 + Kibana
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
@dersteppenwolf
dersteppenwolf / docker-cleanup-resources.md
Last active September 6, 2021 09:58 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@dersteppenwolf
dersteppenwolf / .block
Created September 12, 2018 02:49
Line Chart
license: gpl-3.0
@dersteppenwolf
dersteppenwolf / .block
Created October 17, 2018 00:25
US States Choropleth Small Multiples
license: mit