Skip to content

Instantly share code, notes, and snippets.

View frankrowe's full-sized avatar

Frank Rowe frankrowe

View GitHub Profile
@frankrowe
frankrowe / pie_serv.js
Last active December 27, 2015 18:49 — forked from mattbaker/README
var http = require('http'),
url = require('url'),
jsdom = require('jsdom'),
child_proc = require('child_process'),
w = 400,
h = 400,
scripts = ["file://"+__dirname+"/d3.min.js",
"file://"+__dirname+"/d3.layout.min.js",
"file://"+__dirname+"/pie.js"],
htmlStub = '<!DOCTYPE html><div id="pie" style="width:'+w+'px;height:'+h+'px;"></div>';
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1)$0]]></content>
<tabTrigger>log</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
@frankrowe
frankrowe / .bash_profile
Last active December 20, 2015 12:29
- prompt: user@pwd >_ - sets terminal tab title to pwd (~ = home)
# Git aliases
alias gita='git add'
alias gitc='git commit -m'
alias gits='git status'
alias gitl='git log --oneline --color'
alias gitb='git branch --color'
alias gitu='git reset --HEAD^'
# Other Aliases
alias ls='ls -G'
@frankrowe
frankrowe / shp2gj.py
Last active November 1, 2022 17:54
PyShp, shp to geojson in python
import shapefile
# read the shapefile
reader = shapefile.Reader("my.shp")
fields = reader.fields[1:]
field_names = [field[0] for field in fields]
buffer = []
for sr in reader.shapeRecords():
atr = dict(zip(field_names, sr.record))
geom = sr.shape.__geo_interface__
buffer.append(dict(type="Feature", \
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@frankrowe
frankrowe / nginx.conf
Last active December 18, 2015 15:58
nginx.conf example
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@frankrowe
frankrowe / README.md
Last active December 17, 2015 10:18 — forked from mbostock/.block
#!/bin/bash
#
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (32 bit)
# updated to PostGIS 2.0.1
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@frankrowe
frankrowe / index.html
Last active December 12, 2015 05:48
map boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Map Boilerplate</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.5/leaflet.css" />
<!--[if lte IE 8]> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.5/leaflet.ie.css" /> <![endif]-->