Skip to content

Instantly share code, notes, and snippets.

View keum's full-sized avatar

Peter Keum keum

  • King County - Wastewater Treatment Division
  • Seattle, WA
  • 19:20 (UTC -08:00)
View GitHub Profile
#!/usr/bin/env bash
# This script uses the concept at https://certbot.eff.org/#ubuntuxenial-other
# but overcomes the problem I consistently have of the server (at eff.org)
# not being able to connect to this machine.
mkdir -p /tmp/www
cd /tmp/www
sudo python -m SimpleHTTPServer 80 &
http_pid=$!
CREATE OR REPLACE FUNCTION public.dbs_ned_z(
IN text,
IN text,
OUT text)
RETURNS text AS
$BODY$
#!/bin/sh
url="http://ned.usgs.gov/epqs/pqs.php?output=json&x=$1&y=$2"; /usr/bin/curl -s $url
$BODY$
LANGUAGE plsh VOLATILE
@keum
keum / How to: Resolving GitHub Merge Issue-20130910-merge-commit.md
Last active November 7, 2015 05:35 — forked from joallard/20130910-merge-commit.md
How to: GitHub - Resolving merge issue

So, you've merged the master branch with itself, and you ended up with a merge commit nobody wanted.

The problem

Let me tell you a little story...

John and Pete are working together on a repo.

$ git log --graph --pretty=oneline --abbrev-commit  # an alias I have under 'git lol', but 'gitk' does just fine
* 812492b (master, origin/master, origin/HEAD) Add stuff

Objects

To create a new object, use the new keyword followed by a call to a constructor function. Javascript provides the Object() constructor out-of-the-box:

var toilet = new Object();

Properties

Once you have an object, you can set and get properties on it, like this:

@keum
keum / How to: Paul's gist on ogr_geojson
Last active January 1, 2016 19:29 — forked from mccombsp-kingco/gist:8185605
How To: Gdal using ogr for geojson
Install gdal http://giscollective.org/installing-gdal-mac/
use github http://www.thinkful.com/learn/a-guide-to-using-github-pages/start/existing-project/user-page/
git add .
551 git commit -a -m "testing GeoJSON format"
552 git config --global user.name "mccombsp-kingco"
553 git config --global user.emal [email protected]
554 git commit --amend --reset-author
555 git push
@keum
keum / How to: geojson-conversion.sh
Last active December 31, 2015 04:59 — forked from benbalter/geojson-conversion.sh
How to: Bulk conversion Shape to Geojson
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
1. Install Anaconda to get your python 2.7.
2. Install .Net Framework - dotNetFx45_Full_setup.exe
3. Uninstall the Microsoft Visual C++ 2010 instances.
4. Install the Microsoft SDK - winsdk_web.exe #http://www.microsoft.com/en-us/download/details.aspx?id=8279
5. Install Node.js - http://nodejs.org/download/
6. Open your command prompt as an administrator
>Start
>"cmd" in Search for All Programs
>Ctrl-RightClick on CMD and "Run as Administrator"
7. Set your environment for the SDK (this was tricky to figure out!)