Skip to content

Instantly share code, notes, and snippets.

View wuhland's full-sized avatar

David Saeger wuhland

  • MacFadden
  • Washington DC
View GitHub Profile
@wuhland
wuhland / config.yml
Created February 18, 2018 21:11
DrupalVM with mod_rewrite / .htaccess support
---
# Available `vagrant_box` values include:
# - geerlingguy/centos7
# - geerlingguy/centos6
# - geerlingguy/debian9
# - geerlingguy/debian8
# - geerlingguy/ubuntu1604
# - geerlingguy/ubuntu1404
vagrant_box: geerlingguy/ubuntu1604
@wuhland
wuhland / wh_alt_media.js
Last active December 4, 2017 15:25
Purveyors of alternative facts in the #whitehelmets twitter conversation.
media_sources = [
"mintpressnews.com",
"washingtonsblog.com",
"21stcenturywire.com",
"sputniknews.com",
"clarityofsignal.com",
"rt.com",
"alternet.org",
"unz.com",
"thewallwillfall.org",

Return vector of areas from SpatialPolygon object

sapply(slot(SP, "polygons"), slot, "area")

Function to clip SpatialPolygon to bbox (requires package 'raster')

gClip <- function(shp, bb){
  if(class(bb) == "matrix") b_poly <- as(extent(as.vector(t(bb))), "SpatialPolygons")
 else b_poly &lt;- as(extent(bb), "SpatialPolygons")
@wuhland
wuhland / QGISQueryByDate.md
Last active January 20, 2016 16:58
QGIS: Query By Date
  1. In QGIS ensure that the date field is saved as type 'QDate' by looking at properties:Fields on the layer

  2. Open the attribute layer and toggle the show all features selection in the bottom left corner to Advanced Filter to open the expression based filter toolbar. Alternatively you can press CTRL+F to get to the expression based filter toolbar.

  3. Enter an appropriate filter. The one I used to filter the last 90 days of records looks like this:

 day(age( $now,"EVENT_DATE" )) <= 90

##Fade to Transparent Inner

  1. Copy layer
  2. Top layer white
  3. Bottom layer desired color
  4. Select top layer and apply inner glow with black as the glow color
  5. Select both layers
  6. Click inverted mask on transparency button
@wuhland
wuhland / MergeSHP.md
Last active June 21, 2023 08:06
Merging Shapefiles From Command Line with GDAL\OGR2OGR

First put all the shapefiles you want merged in one directory than I run this bash script in the folder

#!/bin/bash

file="./final/merge.shp"

for i in $(ls *.shp)
do