Skip to content

Instantly share code, notes, and snippets.

View gdmf's full-sized avatar

Grant Miller-Francisco gdmf

  • HDR
  • Ashland, Oregon
View GitHub Profile
@gdmf
gdmf / GIStable2Clipboard.py
Created November 13, 2018 18:04 — forked from pyRobShrk/GIStable2Clipboard.py
ArcPy function to copy the attribute table to clipboard for pasting into Excel
import pandas as pd
def GIStable2Clipboard(inTable, exportFields="all"):
desc = arcpy.Describe(inTable)
if exportFields =="all":
exportFields = [f.name for f in arcpy.ListFields(inTable) if not f.name == desc.shapeFieldName]
aliases = [f.aliasName for f in arcpy.ListFields(inTable) if not f.name == desc.shapeFieldName]
pd.DataFrame.from_records(arcpy.da.TableToNumPyArray(inTable,exportFields),
index=desc.OIDFieldName, columns=aliases).to_clipboard()
@gdmf
gdmf / Python3 Virtualenv Setup.md
Created April 27, 2018 17:44 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
## How to hide API keys from github ##
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while
retaining your commits: https://help.github.com/articles/remove-sensitive-data/
2. In the terminal, create a config.js file and open it up:
touch config.js
atom config.js
@gdmf
gdmf / blender_dem.py
Created November 20, 2017 23:13
First working Python script to generate a hillshaded DEM in Blender, following the instructions in Daniel Huffman's tutorial.
from math import radians
import bpy
DEM_ASPECT_X = 1
DEM_ASPECT_Y = 1.4
DEM_X = 1000
DEM_Y = 1400
SUBDIVIDE_CUT_1 = 500
@gdmf
gdmf / NikolaWindows
Created October 27, 2016 19:54 — forked from franktoffel/NikolaWindows
How to install Nikola on Windows with Anconda-conda env
conda create --name nikolaenv python=3
activate nikolaenv
conda install pillow lxml
pip install Nikola[extras]
(
SynthDef.new(\multi, {
var sig, amp, env;
env = EnvGen.kr(
Env.new([0,1,0],[10,10],[1,-1]);
doneAction:2
);
amp = SinOsc.kr({ExpRand(0.2,12)}!8).range(0,1);
sig = SinOsc.ar({ExpRand(50,1200)}!8);
sig = sig * amp * env;
@gdmf
gdmf / random_transect_generator.py
Last active August 29, 2015 14:24
Useful for generating somewhat random east/west transect lines
import random
outfile = r'<your path here>'
# starting point (UTM easting, northing)
start_x, start_y = (524230, 4671988)
# number of points in a single transect line
num_pts = 100
# one 'transect' consists of an eastward and a westward leg
num_transects = 3
# transect easting variance
@gdmf
gdmf / us.json
Created March 5, 2015 04:59
A demo of TopoJSON on a U.S. counties shapefile from the U.S. census bureau. The same TopoJSON file can also be used to show states. (Source: https://gist.githubusercontent.com/mbostock/4090846/raw/us.json)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gdmf
gdmf / README.md
Last active August 29, 2015 14:09
Whulj I

First stab at a map of The Whulj (Puget Sound), inspired by reading Harvey Manning's book, Walking the Beach to Bellingham. This initial map shows most of the whulj land/water boundary, uses the default mercator projection, has basic zoom behavior, and not much else.

@gdmf
gdmf / index.html
Created December 1, 2012 04:54
d3: Mercator
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.background {
fill: #a4bac7;
}
.foreground {
fill: none;