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
  • 20:06 (UTC -07:00)
View GitHub Profile
{
"version": 8,
"name": "Satellite Streets",
"metadata": {
"mapbox:groups": {
"1444856567853.8965": {
"name": "Country labels",
"collapsed": true
},
"1444856935386.6565": {
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.2/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@keum
keum / How to : GitHub Scenario 2
Created November 7, 2015 05:24
How to: GitHub - Fork other people's project into your repository and copy onto your local machine directory.
Sceanrio 2: Forking other people's repository from GitHub
Step 1: Find other repo you're interested in forking.
Step 2: Click Fork icon from GitHub site to your repository.
Step 3: Go to your local machine where you want to download recently forked project from GitHub
Step 4: $ git clone Http://repository name.git
Step 5: this should download all the directory/files from the repo to local machine's directory.
@keum
keum / How to: Adding Project to GitHub Master
Last active November 7, 2015 05:33
How to: Adding Existing Project into GitHub Page using CLI
Summary from this site: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Easy definition
Local Repository = your laptop folder
Remote Repository = your GitHub account website
Origin = your local directory in your laptop
Master = your copy existing in GitHub site.
Step 1:
@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
@keum
keum / Conference Note: Carto Sympo
Last active November 8, 2015 06:12
Conference Note: Cartographic Symposium - Portland State U Nov 3, 2015
I. Key Note: James Meacham University of Oregon - Dept of Geography
Infographic Lab - http://infographics.uoregon.edu/projects/
Talked about workflow for Visualizing Data with example from Atlas of Wildlife Migration (http://infographics.uoregon.edu/projects/atlas-of-wildlife-migration/)
1. Data Collection --> Developing storyline:Markup iwth white board (inital mockup)/conceptialization -->Collaborative Design (example of working w/ biologist, dash-line showing two overlap direction) --> Outreach to social media/newspaper. Finished product: http://migrationinitiative.org/content/atlas
Take away - using whiteboard to draw up initial ideas/product and collaborate with subject matter experts.
Potential use for WTD: infographic of each pipe segment, profile DSM, landuse similar to last page bottom graphics from the report.
@keum
keum / How to: GitHub Scenario 1
Last active November 9, 2015 18:15
How to: Using GitHub Local Scenario 1 - Local project to GitHub repo using terminal command line
Scenario 1: One starts the project in your local directory and need to push whole directory into your repository in GitHub website.
=====================================================================================================================================
Step 1: Create a github repo in the web WITHOUT README.md file.
Step 2: Go to your local machine and to the directory where all the files are located. Example >cd yourdirectory
Step 3: Go create README.md file. Example Type $touch echo "#new repo" >> README.md (this creates a new README.md file with new repo text inside)
Step 4: Still in your local directory where your project directory is,
$ git init
Step 5: $ git add README.md
Step 6: $ git commit -m 'first commit' (need to type exactly first commit)
Step 7: $ git remote add origin remote repository URL i.e. http://your repository.git
@keum
keum / NCI-Data
Last active November 30, 2015 16:22
NorthCreekInterceptor
Existing and New Manholes - q:\...\North_Ck_Interceptor\shapes
\mhFinalDesign20140520.shp
Proposed New Sewerline - q:\..\North_CK_Interceptor\shapes\PipeFinalDesign_20140520.shp
Modified to add Reach Section and Pipe diameter
Combined Dewatering Wells(DW) and Monitoring Wells (MW) - q:\..\North_CK_Interceptor\shapes
\combine_dewatering_monitoringWells20151110.shp
Previously installed existing monitoring wells - q:\..\North_Ck_Interceptor\shapes\
@keum
keum / list_comprehension from mattmakesmap
Last active December 23, 2015 01:49
Python - list comprehension and string formatting procedure to take a list and add specific string to all the list.
"""
Question One:
Why does the join method not add ".cso" to "king"
"""
a=('seattle','chelan','king')
print ".cso ".join(a) # returns "seattle.cso chelan.cso king"
"""
Answer:
@keum
keum / CSV to JSON format in python
Last active December 23, 2015 07:59
Python example on converting CSV into JSON format
This example came from Tom MacWright
Python standard library (plus simplejson for decimal encoding support) has all you need:
import csv, simplejson, decimal, codecs
data = open("in.csv")
reader = csv.DictReader(data, delimiter=",", quotechar='"')
with codecs.open("out.json", "w", encoding="utf-8") as out: